#include <socket.h>
Public Member Functions | |
| Socket () | |
| Constructor. | |
| ~Socket () | |
| Destructor. | |
| bool | sendStr (string) |
| Send a string to the server. | |
| bool | closeSock () |
| Close the socket. | |
| bool | connectSock (int, string, string) |
| Connect the socket to the server. | |
| bool | getState () |
| Get connection state. | |
| string | receive () |
| Receive a string from the server. | |
Private Attributes | |
| bool | state |
| Socket state. | |
| int | mySock |
| Socket handle. | |
This class manage the connection with the irc server. It uses a socket for communication
Definition at line 53 of file socket.h.
| Socket::Socket | ( | ) |
| Socket::~Socket | ( | ) |
| bool Socket::closeSock | ( | ) |
Close the socket.
Close the socket
Definition at line 95 of file socket.cpp.
Referenced by receive(), BotKernel::reconnect(), BotKernel::run(), and ~Socket().
| bool Socket::connectSock | ( | int | port, | |
| string | serverName, | |||
| string | dedicatedIP | |||
| ) |
Connect the socket to the server.
Connect the socket to a server The socket can be "block type" and use a dedicated IP adress
| port | Server port | |
| serverName | Server IP or hostname | |
| dedicatedIP | Dedicated IP used for connextion. Empty if not used |
Definition at line 56 of file socket.cpp.
Referenced by BotKernel::connect(), danstonchat(), planet(), tele(), trad(), and wiki().
| bool Socket::getState | ( | ) |
Get connection state.
Get connection state
Definition at line 110 of file socket.cpp.
References state.
Referenced by BotKernel::run().
| string Socket::receive | ( | ) |
Receive a string from the server.
Receive a string from the server
Definition at line 119 of file socket.cpp.
References closeSock(), mySock, and state.
Referenced by danstonchat(), planet(), BotKernel::run(), tele(), trad(), and wiki().
| bool Socket::sendStr | ( | string | strData | ) |
Send a string to the server.
Send a string to the server
| strData | String to send |
Definition at line 153 of file socket.cpp.
References mySock.
Referenced by danstonchat(), planet(), BotKernel::send(), tele(), trad(), and wiki().
int Socket::mySock [private] |
Socket handle.
Definition at line 74 of file socket.h.
Referenced by closeSock(), connectSock(), receive(), sendStr(), and Socket().
bool Socket::state [private] |
Socket state.
Definition at line 72 of file socket.h.
Referenced by closeSock(), connectSock(), getState(), receive(), and Socket().
1.5.8