#include <socket.h>
Public Methods | |
| Socket (SOCKET mSock, int size=4096) | |
| Socket (const Socket &r_sock) | |
| virtual | ~Socket () |
| char | Read () |
| void | Write (const char c) |
| void | Write (const string &r_str) |
| void | Write (const char *p_char) |
| void | Write (const char *p_char, int len) |
| void | Flush () |
| SOCKET | GetSocket () |
| void | Close () |
Private Methods | |
| Socket & | operator= (const Socket &r_sock) |
Private Attributes | |
| SOCKET | mSock |
| network socket | |
| int | mSize |
| size of buffers | |
| char * | mpInBuffer |
| the socket input buffer. | |
| char * | mpOutBuffer |
| the socket output buffer. | |
| char * | mpRead |
| pointer to the start of data in mpInBuffer. | |
| char * | mpEod |
| pointer to the end of data in mpInBuffer. | |
| char * | mpWrite |
| pointer to the next write position in mpOutBuffer. | |
| char * | mpStartWrite |
| pointer to the data to start send in mpOutBuffer. | |
Definition at line 53 of file socket.h.
|
||||||||||||
|
The constructor for Socket
Definition at line 24 of file socket.cpp. References mpEod, mpInBuffer, mpOutBuffer, mpRead, mpStartWrite, mpWrite, and mSize. |
|
|
The copy constructor for Socket
Definition at line 36 of file socket.cpp. References mpEod, mpInBuffer, mpOutBuffer, mpRead, mpStartWrite, mpWrite, and mSize. |
|
|
Destructor for Socket Definition at line 53 of file socket.cpp. References mpInBuffer, and mpOutBuffer. |
|
|
Close is called to close a Socket stream. Definition at line 240 of file socket.cpp. Referenced by Connection::Disconnect(). |
|
|
Flush sends the contents of the mOutBuffer to the socket stream. One must call flush to actually send the data in the buffer, although the buffer will automatically flush itself when it reaches mSize.
Definition at line 203 of file socket.cpp. References mpOutBuffer, mpStartWrite, mpWrite, mSize, and mSock. Referenced by Connection::HandleOutput(), and Write(). |
|
|
GetSocket gets the sockets value.
Definition at line 233 of file socket.cpp. References mSock. Referenced by Connection::GetSocket(). |
|
|
|
|
|
Read fetches a single character from the socket stream. We buffer our reads here.
Definition at line 69 of file socket.cpp. References mpEod, mpInBuffer, mpRead, mSize, and mSock. Referenced by Close(), and Connection::HandleInput(). |
|
||||||||||||
|
Write pushes the contents of a character array to the socket stream.
Definition at line 185 of file socket.cpp. References Write(). |
|
|
Write pushes the contents of a null terminated character array to the socket stream.
Definition at line 160 of file socket.cpp. References Write(). |
|
|
Write pushes the contents of a string to the socket stream.
Definition at line 133 of file socket.cpp. References Write(). |
|
|
Write pushes a single character to the socket stream. We buffer our writes here. One must call flush to actually send the data in the buffer, although the buffer will automatically flush itself when it reaches mSize.
Definition at line 106 of file socket.cpp. References Flush(), mpOutBuffer, mpWrite, and mSize. Referenced by Connection::HandleOutput(), and Write(). |
|
|
pointer to the end of data in mpInBuffer.
|
|
|
the socket input buffer.
|
|
|
the socket output buffer.
|
|
|
pointer to the start of data in mpInBuffer.
|
|
|
pointer to the data to start send in mpOutBuffer.
|
|
|
pointer to the next write position in mpOutBuffer.
|
|
|
size of buffers
|
|
|
network socket
|
1.2.17