#include <datagram.h>
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. | |
Note that the client can't receive a datagram.
| 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.
| 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.
| message | the message and ip:port to send to. |
log karoo::datagram_client::logger [protected] |
you need to set this up if you want logs to e.g.
console
1.5.8