Public Types |
enum | {
modeInvalid = 0,
modeWriteOkay = 1,
modeSendOkay = 2,
modeReadOkay = 4,
modeClosing = 8,
modeNotified = 16,
modeClosed = 32,
modeValid = modeSendOkay|modeWriteOkay|modeReadOkay,
modeAll = 0xFFFFFFFF
} |
| Not used. More...
|
Public Methods |
| ServerSocket (const unsigned32 nBufferSize=18000, const int iTimeout=DEFAULT_SOCKET_TIMEOUT) |
| ServerSocket (const SocketInstance &socket, const SockAddr &sa, const unsigned32 nBuffSize, const int iTimeout) |
virtual | ~ServerSocket () |
void | sendPacket (const PacketBuffer &packet) |
| Will add to outgoing buffer, and try sending it. More...
|
void | sendPacket (const PacketBuffer *const ppacket) |
| Will add to outgoing buffer, and try sending it. More...
|
void | sendBuffer () |
| Will attept to send any data in the outgoing buffer. More...
|
int | readData () |
| Reads in as much data is available on the socket. More...
|
PacketBuffer * | extractPacket () |
| Extracts a packet from the incoming buffer. More...
|
const Flags & | flags () const |
| Returns the socket flags. (Not currently used.). More...
|
unsigned32 | getOutBufferSize () const |
| Return bytes in outgoing buffer. More...
|
unsigned32 | getOutBufferSizeMax () const |
| Return the actual size (how much was allocated) of the buffer. More...
|
unsigned32 | getInBufferSize () const |
| Return bytes in incoming buffer. More...
|
unsigned32 | getBufferSizeMax () const |
| How big the in/out buffer is. More...
|
SockAddr | getAddr () const |
| Gets the socket address information of the connected socket. More...
|
int | socketTimeout () const |
| Returns the number of seconds a send/receive operation will wait before throwing. More...
|
ServerHandler * | serverHandler () const |
| Returns the ServerHandler object that was assigned to this server socket object. More...
|
void | setServerHandler (ServerHandler *s) |
| Sets the ServerHandler object that this server socket will use. More...
|
Protected Methods |
char * | getOutBuffer () const |
char * | getInBuffer () const |
void | rotateBuffer (char *pbuffer, unsigned32 nBuffSize, unsigned32 nBytesRotatingOut) |
void | addPacketBuffer (const PacketBuffer *const ppacket) |
| ServerSocket (const ServerSocket &) |
ServerSocket & | operator= (const ServerSocket &) |
Protected Attributes |
ServerHandler * | m_pserverHandler |
SockAddr | m_socketAddr |
unsigned32 | m_nID |
int | m_iTimeout |
Flags | m_flags |
char * | m_pInBuff |
char * | m_pOutBuff |
char * | m_pOutPtr |
char * | m_pInPtr |
unsigned32 | m_nBytesIn |
unsigned32 | m_nBytesOut |
unsigned32 | m_nBufferSizeMax |
The Server Socket object contains an incoming buffer for data that is read in and isn't parsed, and an outgoing buffer for data that hasn't been sent. The SimpleServer object uses this object for every connection that comes in.