class SocketClient


 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods


Detailed Description

 SocketClient (const Iptuple& iptuple, EventLoop& e, bool md5sig = false)

SocketClient

Parameters:

iptuplespecification of the connection endpoints.
 ~SocketClient ()

~SocketClient

typedef XorpCallback1<void, bool>::RefPtr ConnectCallback

ConnectCallback

Callback for connection attempts.

void  connect (ConnectCallback cb)

connect

Asynchronously connect.

Parameters:

cbis called when connection suceeds or fails.
void  connect_break ()

connect_break

Break asynchronous connect attempt.

Each instance of the this class has a single connection associated with it. If while we are attemping to connect to a peer (using connect()), the peer connects to us. It is necessary to stop the outgoing connect.

void  connected (XorpFd s)

connected

The peer has initiated the connection so form an association.

Parameters:

sincoming socket file descriptor
void  flush_transmit_queue ()

flush_transmit_queue

Throw away all the data that is queued to be sent on this socket.

void  stop_reader ()

stop_reader

Stop reading data on this socket.

void  disconnect ()

disconnect

Disconnect this socket.

bool  disconnecting ()

disconnecting

Returns: Are we currrent disconecting.

typedef XorpCallback4<bool,BGPPacket::Status,const uint8_t*,size_t, SocketClient*>::RefPtr MessageCallback

MessageCallback

Callback for incoming data.

Parameters:

constuint8_t* pointer to data.
size_tlength of data.
void  set_callback (const MessageCallback& cb)

set_callback

Set the callback for incoming data.

enum Event { DATA = AsyncFileWriter::DATA, FLUSHING = AsyncFileWriter::FLUSHING, ERROR = AsyncFileWriter::OS_ERROR }

Event

typedef XorpCallback2<void,Event,const uint8_t*>::RefPtr SendCompleteCallback

SendCompleteCallback

Callback for data transmission.

Parameters:

Eventstatus of the send.
constuint8_t* pointer to the transmitted data. Allows caller to free the data.
bool  send_message (const uint8_t* buf, size_t cnt, SendCompleteCallback cb)

send_message

Asynchronously Send a message.

Parameters:

bufpointer to data buffer.
cntlength of data buffer.
cbnotification of success or failure.

Returns: true if the message is accepted.

bool  output_queue_busy ()

output_queue_busy

[const]

Flow control signal.

Data will be queued for transmission until a resource such as memory is exceeded. A correctly written client should stop sending messages if the output queue is not draining.

Returns: true if its time to stop sending messages.

int  output_queue_size ()

output_queue_size

[const]

Returns: number of messages in the output queue.

bool  is_connected ()

is_connected

Returns: true if a session exists.

bool  still_reading ()

still_reading

Returns: true if we are still reading.


Generated by: pavlin on possum.icir.org on Wed Mar 21 11:23:48 2007, using kdoc $.