Inheritance diagram for CP_ServerSocket:
Getters | |
UInt32 | GetAddress () const |
CP_NetworkAddress | GetNetworkAddress () const |
UInt32 | GetPeerAddress () const |
CP_NetworkAddress | GetPeerNetworkAddress () const |
UInt16 | GetPort () const |
UInt16 | GetPeerPort () const |
CP_String | GetHostName () |
static UInt32 | GetHostByName (const CP_String &inHostName) |
static CP_NetworkAddress | GetHostAddressByName (const CP_String &inHostName) |
Public Member Functions | |
Constructor / Destructor | |
CP_ServerSocket () | |
Constructor. | |
CP_ServerSocket (UInt32 inAddress, UInt16 inPort) | |
CP_ServerSocket (const CP_NetworkAddress &inAddress, UInt16 inPort) | |
virtual | ~CP_ServerSocket () throw () |
Destructor. | |
Listing | |
void | BeginListening (SInt16 queSize=SOMAXCONN) |
void | BeginListening (UInt32 inAddress, UInt16 inPort, SInt16 queSize=SOMAXCONN) |
void | BeginListening (const CP_NetworkAddress &inAddress, UInt16 inPort, SInt16 queSize=SOMAXCONN) |
CP_Socket * | Accept () |
Connection | |
void | Connect (UInt32 inTimeoutInSeconds=0) |
void | Connect (UInt32 inAddress, UInt16 inPort, UInt32 inTimeoutInSeconds=0) |
void | Connect (const char *inAddress, UInt16 inPort, UInt32 inTimeoutInSeconds=0) |
void | Connect (const CP_NetworkAddress &inAddress, UInt16 inPort, UInt32 inTimeoutInSeconds=0) |
Data Transfer | |
void | Send (const CP_String &inMessage) |
void | Send (const void *inData, UInt32 inDataLength) |
SInt32 | Receive (void *inOutBuffer, UInt32 inOutBufferLength) |
UInt32 | Available () const |
bool | HasBytesAvailable () const |
Misc | |
UInt32 | GetHostID () |
Terminate | |
void | Close () |
void | CloseInput () |
void | CloseOutput () |
Testers | |
bool | IsConnected (char rdwr=-1) const |
bool | IsConnectionClosed (UInt32 inTimeoutInMicroseconds=10000) const |
Connection | |
void | Connect (UInt32 inTimeoutInSeconds=0) |
void | Connect (UInt32 inAddress, UInt16 inPort, UInt32 inTimeoutInSeconds=0) |
void | Connect (const char *inAddress, UInt16 inPort, UInt32 inTimeoutInSeconds=0) |
void | Connect (const CP_NetworkAddress &inAddress, UInt16 inPort, UInt32 inTimeoutInSeconds=0) |
Data Transfer | |
void | Send (const CP_String &inMessage) |
void | Send (const void *inData, UInt32 inDataLength) |
SInt32 | Receive (void *inOutBuffer, UInt32 inOutBufferLength) |
UInt32 | Available () const |
bool | HasBytesAvailable () const |
Misc | |
UInt32 | GetHostID () |
Terminate | |
void | Close () |
void | CloseInput () |
void | CloseOutput () |
Testers | |
bool | IsConnected (char rdwr=-1) const |
bool | IsConnectionClosed (UInt32 inTimeoutInMicroseconds=10000) const |
Protected Member Functions | |
void | Initialize (void) |
void | GetConnectedSocketInfo (void) |
Create | |
virtual CP_Socket * | createSocket (int s) |
Create | |
virtual CP_Socket * | createSocket (SOCKET s) |
Create | |
virtual CP_Socket * | createSocket (int s) |
Protected Attributes | |
CP_String | fHostName |
char | fIsConnected |
sockaddr_in | fSocketAddress |
hostent * | fnlp_host |
int | fSocketDescriptor |
SOCKET | fSocketDescriptor |
CP_NetworkAddress | fConnectedSocketAddress |
UInt16 | fConnectedSocketPort |
CP_NetworkAddress | fConnectedPeerAddress |
UInt16 | fConnectedPeerPort |
Private Member Functions | |
Binding | |
void | BindTo (UInt32 inAddress, UInt16 inPort) |
void | BindTo (const CP_NetworkAddress &inAddress, UInt16 inPort) |
Private Attributes | |
bool | fListening |
|
Constructor.
|
|
Constructor.
|
|
Constructor.
|
|
Destructor.
|
|
Begin listening for connections.
|
|
Begin listening for connections.
|
|
Begin listening for connections.
|
|
Wait for an incoming connection. Please note that this is a blocking call! You will not return from this call until a connection is received, or this socket is shutdown.
Plugin point. Override if you want to create a special socket class to handle an accepted connection.
|
|
Bind the allocated socket to a specific address and port.
|
|
Bind the allocated socket to a specific address and port.
|
|
Is the socket currently accepting connections. |
|
|
|
|
|
Establish a connection with the host.
|
|
Establish a connection with the host.
|
|
Establish a connection with the host.
|
|
Establish a connection with the host.
|
|
Sends data over the socket connection.
|
|
Sends data over the socket connection.
|
|
Receives data from the socket connection.
|
|
Returns the number of bytes available on the socket connection.
|
|
Returns if there are bytes available at the socket connection.
|
|
Returns the host from the passed in host name.
|
|
Returns the host from the passed in host name.
|
|
Return an UInt32 containing the address we are communicating over.
|
|
Return an GetNetworkAddress containing the address we are communicating over.
|
|
Return an UInt32 containing the peer address we are communicating with.
|
|
Return a CP_NetworkAddress containing the peer address we are communicating with.
|
|
Returns the port we are communicating over.
|
|
Returns the port of the peer are communicating with.
|
|
Returns the name of the host as a string.
|
|
Return an UInt32 containing the peer address we are communicating with.
|
|
Closes the connection to the socket.
|
|
Closes the input connection of the socket.
|
|
Closes the output connection of the socket.
|
|
Return true if we have a current connection.
|
|
Returns if the connection has closed.
|
|
Initializes the socket members called from every constructor.
|
|
|
|
|
|
|
|
CP_String containing the name of the host. |
|
flag to indicate if we are currently connected. |
|
a sockaddr_in structure with the current address info. |
|
|
|
|
|
|
|
|
|
|
|
|