#include <connection.h>
Public Methods | |
| Connection (SOCKET sock) | |
| virtual | ~Connection () |
| Connection (const Connection &r_conn) | |
| virtual void | HandleInput () |
| virtual void | HandleOutput () |
| virtual bool | CanBeDisconnected () |
| virtual void | Disconnect () |
| virtual void | SendMsg (const string &r_msg) |
| virtual string * | ReadMsg () |
| virtual SOCKET | GetSocket () |
Protected Methods | |
| Connection & | operator= (const Connection &r_conn) |
Protected Attributes | |
| SOCKET | mSock |
| network socket | |
| bool | mDisconnectable |
| flag indicating connection wishes to be disconnected | |
| list< string > | mInBuffer |
| buffered lines waiting to be processed | |
| list< string > | mOutBuffer |
| buffered lines waiting to be output | |
| char * | mpPendingOutput |
| pending output on socket | |
| char * | mpPendingInput |
| pending or not fully formed input on socket | |
Definition at line 23 of file connection.h.
|
|
Constructor for Connection. There is no default constructor as all connections must be constructed with a socket. Definition at line 18 of file connection.cpp. |
|
|
Destructor for Connection Definition at line 26 of file connection.cpp. References mpPendingInput, and mpPendingOutput. |
|
|
Copy Constructor for Connection Definition at line 35 of file connection.cpp. References mInBuffer, mOutBuffer, mpPendingInput, and mpPendingOutput. |
|
|
CanBeDisconnected is called to query the Connection in order to see whether it wants to be disconnected. Currently this status is set only when there is an error.
Definition at line 251 of file connection.cpp. References mDisconnectable. |
|
|
Disconnect is called to shutdown a Connection's socket. Definition at line 205 of file connection.cpp. References mSock. |
|
|
GetSocket
Definition at line 261 of file connection.cpp. References mSock. |
|
|
HandleInput is called to order a connection to process any input waiting on its socket. Input is parsed into lines based on the occurance of the CRLF terminator and pushed into a buffer which is a list of lines. The buffer expands dynamically as input is processed. Input that has yet to see a CRLF terminator is left in the Connection's pPendingInput array.
Definition at line 87 of file connection.cpp. References mDisconnectable, mInBuffer, mpPendingInput, and mSock. |
|
|
HandleOutput is called to order a connection to process any output waiting on its socket.
Definition at line 154 of file connection.cpp. References mDisconnectable, mOutBuffer, mpPendingOutput, and mSock. |
|
|
Assignment operator for Connection Definition at line 54 of file connection.cpp. References mInBuffer, mOutBuffer, mpPendingInput, and mpPendingOutput. |
|
|
ReadMsg removes a message from the Connection's input buffer.
Definition at line 233 of file connection.cpp. References mInBuffer. |
|
|
SendMsg places a message on the Connection's output buffer.
Definition at line 223 of file connection.cpp. References mOutBuffer. Referenced by Server::Run(). |
|
|
flag indicating connection wishes to be disconnected
Definition at line 51 of file connection.h. Referenced by CanBeDisconnected(), HandleInput(), and HandleOutput(). |
|
|
buffered lines waiting to be processed
Definition at line 53 of file connection.h. Referenced by Connection(), HandleInput(), operator=(), and ReadMsg(). |
|
|
buffered lines waiting to be output
Definition at line 55 of file connection.h. Referenced by Connection(), HandleOutput(), operator=(), and SendMsg(). |
|
|
pending or not fully formed input on socket
Definition at line 59 of file connection.h. Referenced by Connection(), HandleInput(), operator=(), and ~Connection(). |
|
|
pending output on socket
Definition at line 57 of file connection.h. Referenced by Connection(), HandleOutput(), operator=(), and ~Connection(). |
|
|
network socket
Definition at line 49 of file connection.h. Referenced by Disconnect(), GetSocket(), HandleInput(), and HandleOutput(). |
1.2.17