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_);
Encapsulation of a connected UDP socket.
An incapsulation of TCP/UDP Internet Protocol socket address structure.
#define trace(s)
trace() is used to trace function call chain in C++ program.
UNIXAddress encapsulates UNIX domain socket 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.
bool connect(const Address &peer_addr_)
Connect socket to the peer.
void unconnect()
Unconnect connected socket.
int write(const char *buf_=NULL, const unsigned int size_=0)
Perform blocking write by writing packet of specified size.
int read(char *buf_, const unsigned int size_)
Read specified number of bytes off the socket.
SA * getAddress() const
Get hold of address structure.
void setstate(iostate flag_)
Set socket state to flag_ by adding flag_ to the existing state.
@ eofbit
indicates that an input operation reached the end of an input sequence
@ failbit
indicates that an input operation failed to read the expected characters, or that an output operation...
const int getDomain() const
Get socket domain type.
handler_t getHandler() const
Get socket file descriptor.
SA * getAddress() const
Retrieve underlying address structure.