SADB-Client  0.99
Situational Awareness Database
 All Classes Functions Variables
Public Member Functions | Public Attributes | List of all members
SADB::Network Class Reference

Public Member Functions

void Close (void)
 Close a Socket.
 
void Server (int port, int MaxQueue)
 
int ConnectTo (const char *address, int port)
 
int WaitForConnection (void)
 Wait for a connection.
 
int Receive (unsigned char *Buffer, int MaxLength)
 
int ReceiveExactly (unsigned char *Buffer, int Length)
 
int Send (unsigned char *Buffer)
 
int Send (unsigned char *Buffer, int Length)
 
int Sendf (unsigned char *format,...)
 

Public Attributes

int Socket
 Socket Descriptor.
 
int Port
 Port Number.
 

Member Function Documentation

int Network::ConnectTo ( const char *  address,
int  port 
)

Connect to a server

Parameters
[in]addressAddress to connect to
[in]portPort to use
int Network::Receive ( unsigned char *  Buffer,
int  MaxLength 
)

Receive data from the socket

Parameters
[in]SocketSocket to use
[out]BufferPointer to memory location where data read is to be stored
[in]MaxLengthMaximum data to be read
Returns
Number of bytes read
int Network::ReceiveExactly ( unsigned char *  Buffer,
int  Length 
)

Receive a complete Packet from the socket

Parameters
[in]SocketSocket to use
[out]BufferPointer to memory location where data read is to be stored
[in]LengthMaximum data to be read
Returns
Number of bytes read
int Network::Send ( unsigned char *  Buffer)

Send a string

Parameters
[in]SocketSocket to use
[out]BufferPointer to memory location where data to be sent is stored
int Network::Send ( unsigned char *  Buffer,
int  Length 
)

Send Data

Parameters
[in]SocketSocket to use
[in]BufferPointer to memory location where data to be sent is stored
[in]LengthNumber of bytes to be sent
int Network::Sendf ( unsigned char *  format,
  ... 
)

Send a Formatted String

Parameters
[in]SocketSocket to use
[out]formatFormat string
[in]...Additional variables
void Network::Server ( int  port,
int  MaxQueue 
)

Open a server socket

Parameters
[in]portPort to use

The documentation for this class was generated from the following files: