Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

CL_UniformSocket Class Reference

#include <network_delivery_socket.h>

Inheritance diagram for CL_UniformSocket:

Inheritance graph
[legend]
Collaboration diagram for CL_UniformSocket:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual int get_socket ()
 CL_UniformSocket (CL_ConnectionProvider *provider)
virtual ~CL_UniformSocket ()
virtual bool try_connect (unsigned long remote_ip_network_format, int port)
virtual bool init_socket (int init_socket=-1)
virtual bool peek ()
virtual CL_ConnectionPacket receive ()
 retval: True if a message can be received by a call to receive().

virtual void send (CL_ConnectionPacket message)
virtual bool connection_lost ()
 param: message - Message/data to be sent.

bool send_avail ()

Protected Types

enum  { expect_magic, expect_packet_size, expect_packet_data, packet_finished }

Protected Methods

unsigned long read_int ()
void write_int (unsigned long value)
void write_data (void *data, unsigned int size)
bool read_avail ()
bool require_avail (unsigned int size)
bool get_avail (void *buf, unsigned int size)

Protected Attributes

CL_SOCKET sock
bool is_connection_lost
char* cur_message
int cur_message_size
enum CL_UniformSocket:: { ... }  recv_state
CL_ConnectionProviderprovider

Private Attributes

std::string recv_buffer
std::queue<std::string> send_buffer
int send_pos

Member Enumeration Documentation

anonymous enum [protected]
 

Enumeration values:
expect_magic  
expect_packet_size  
expect_packet_data  
packet_finished  

Definition at line 93 of file network_delivery_socket.h.


Constructor & Destructor Documentation

CL_UniformSocket::CL_UniformSocket ( CL_ConnectionProvider * provider )
 

virtual CL_UniformSocket::~CL_UniformSocket ( ) [virtual]
 


Member Function Documentation

virtual bool CL_UniformSocket::connection_lost ( ) [virtual]
 

param: message - Message/data to be sent.

Reimplemented from CL_Connection.

Reimplemented in CL_UniformAcceptSocket.

bool CL_UniformSocket::get_avail ( void * buf,
unsigned int size ) [protected]
 

int CL_UniformSocket::get_socket ( ) [inline, virtual]
 

Definition at line 64 of file network_delivery_socket.h.

virtual bool CL_UniformSocket::init_socket ( int init_socket = -1 ) [virtual]
 

virtual bool CL_UniformSocket::peek ( ) [virtual]
 

Reimplemented from CL_Connection.

Reimplemented in CL_UniformAcceptSocket.

bool CL_UniformSocket::read_avail ( ) [protected]
 

unsigned long CL_UniformSocket::read_int ( ) [protected]
 

virtual CL_ConnectionPacket CL_UniformSocket::receive ( ) [virtual]
 

retval: True if a message can be received by a call to receive().

Reimplemented from CL_Connection.

Reimplemented in CL_UniformAcceptSocket.

bool CL_UniformSocket::require_avail ( unsigned int size ) [protected]
 

virtual void CL_UniformSocket::send ( CL_ConnectionPacket message ) [virtual]
 

Reimplemented from CL_Connection.

Reimplemented in CL_UniformAcceptSocket.

bool CL_UniformSocket::send_avail ( )
 

virtual bool CL_UniformSocket::try_connect ( unsigned long remote_ip_network_format,
int port ) [virtual]
 

Reimplemented in CL_UniformAcceptSocket.

void CL_UniformSocket::write_data ( void * data,
unsigned int size ) [inline, protected]
 

void CL_UniformSocket::write_int ( unsigned long value ) [protected]
 


Member Data Documentation

char* CL_UniformSocket::cur_message [protected]
 

Definition at line 85 of file network_delivery_socket.h.

int CL_UniformSocket::cur_message_size [protected]
 

Definition at line 86 of file network_delivery_socket.h.

bool CL_UniformSocket::is_connection_lost [protected]
 

Definition at line 83 of file network_delivery_socket.h.

CL_ConnectionProvider* CL_UniformSocket::provider [protected]
 

Definition at line 105 of file network_delivery_socket.h.

std::string CL_UniformSocket::recv_buffer [private]
 

Definition at line 109 of file network_delivery_socket.h.

enum { ... } CL_UniformSocket::recv_state [protected]
 

std::queue<std::string> CL_UniformSocket::send_buffer [private]
 

Definition at line 110 of file network_delivery_socket.h.

int CL_UniformSocket::send_pos [private]
 

Definition at line 111 of file network_delivery_socket.h.

CL_SOCKET CL_UniformSocket::sock [protected]
 

Definition at line 82 of file network_delivery_socket.h.


The documentation for this class was generated from the following file:
Generated at Wed Apr 4 19:57:35 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001