karoo::datagram_client Class Reference

This class allows you to send a datagram. More...

#include <datagram.h>

List of all members.

Public Member Functions

void setLogger (const log &logger)
 Set the logger object.
datagram_status create ()
 create the client socket.
datagram_status write (datagram_message *message)
 Send the datagram.
datagram_status getStatus () const
 get the current status of the client

Protected Member Functions

void close ()
 close the socket.

Protected Attributes

karoo_mutex sem
 to make sure write() is called synchronously
int sock
 the socket file handle
datagram_status status
 the current status of the client
log logger
 you need to set this up if you want logs to e.g.


Detailed Description

This class allows you to send a datagram.

Note that the client can't receive a datagram.


Member Function Documentation

void karoo::datagram_client::close (  )  [protected]

close the socket.

This is only ever called by the destructor

datagram_status karoo::datagram_client::create (  ) 

create the client socket.

This must be called before write() is called

void karoo::datagram_client::setLogger ( const log &  logger  )  [inline]

Set the logger object.

Parameters:
logger the log object for sending warninfs, errors etc... to

datagram_status karoo::datagram_client::write ( datagram_message message  ) 

Send the datagram.

Note that the address that the datagram is sent to is contained in the datagram_message object.

Parameters:
message the message and ip:port to send to.
Returns:
DATAGRAM_OK if all was OK.


Member Data Documentation

you need to set this up if you want logs to e.g.

console


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

Generated on Tue Feb 16 15:04:30 2010 for Karoo by  doxygen 1.5.8