25 char self[] =
"ConUDPSocket::connect";
trace(
self);
42 char self[] =
"ConUDPSocket::unconnect";
trace(
self);
48 addrp->sin_family = AF_UNSPEC;
57 addrp->sun_family = AF_UNSPEC;
64 read(
char* packet_,
const unsigned int size_)
72 else if ( len == 0 ) {
80 write (
const char* packet_,
const unsigned int size_)
82 return ::write(
getHandler(), (
const void*) packet_, size_);
int read(char *buf_, const unsigned int size_)
Read specified number of bytes off the socket.
bool connect(const Address &peer_addr_)
Connect socket to the peer.
#define trace(s)
trace() is used to trace function call chain in C++ program.
An incapsulation of TCP/UDP Internet Protocol socket address structure.
handler_t getHandler() const
Get socket file descriptor.
indicates that an input operation failed to read the expected characters, or that an output operation...
SA * getAddress() const
Retrieve underlying address structure.
virtual SA * getAddress() const =0
Retrieve pointer to the address structure.
virtual const int getLength() const =0
Return length of the underlying address structure.
int write(const char *buf_=NULL, const unsigned int size_=0)
Perform blocking write by writing packet of specified size.
SA * getAddress() const
Get hold of address structure.
const int getDomain() const
Get socket domain type.
void setstate(iostate flag_)
Set socket state to flag_ by adding flag_ to the existing state.
void unconnect()
Unconnect connected socket.
UNIXAddress encapsulates UNIX domain socket address structure.
indicates that an input operation reached the end of an input sequence
Encapsulation of a connected UDP socket.