![]() |
CPPMyth
Library to interoperate with MythTV server
|


Public Member Functions | |
| UdpServerSocket (size_t bufferSize) | |
| int | GetErrNo () const |
| bool | Create (SOCKET_AF_t af) |
| bool | IsValid () const |
| bool | Bind (unsigned port, bool reuse=false) |
| bool | Bind (const char *addr, unsigned port, bool reuse=false) |
| bool | SetMulticastTTL (int multicastTTL) |
| bool | SetMulticastMembership (const char *group, bool join) |
| size_t | AwaitIncoming () |
| std::string | GetRemoteAddrInfo () const |
| bool | SendData (const char *, size_t) |
| size_t | ReceiveData (void *buf, size_t n) |
| size_t | ReadData (void *buf, size_t n) |
| net_socket_t | GetHandle () const |
| Public Member Functions inherited from NSROOT::NetSocket | |
| void | SetTimeout (timeval timeout) |
Private Member Functions | |
| UdpServerSocket (const UdpServerSocket &) | |
| UdpServerSocket & | operator= (const UdpServerSocket &) |
Private Attributes | |
| SocketAddress * | m_addr |
| SocketAddress * | m_from |
| net_socket_t | m_socket |
| int | m_errno |
| char * | m_buffer |
| char * | m_bufptr |
| size_t | m_buflen |
| size_t | m_rcvlen |
Additional Inherited Members | |
| Protected Attributes inherited from NSROOT::NetSocket | |
| struct timeval | m_timeout |
| UdpServerSocket::UdpServerSocket | ( | ) |
Definition at line 1075 of file socket.cpp.
| UdpServerSocket::UdpServerSocket | ( | size_t | bufferSize | ) |
Definition at line 1090 of file socket.cpp.
| UdpServerSocket::~UdpServerSocket | ( | ) |
Definition at line 1104 of file socket.cpp.
| size_t UdpServerSocket::AwaitIncoming | ( | ) |
Wait for incoming data.
Definition at line 1386 of file socket.cpp.
References IsValid().
Referenced by ReceiveData().

| bool UdpServerSocket::Bind | ( | const char * | addr, |
| unsigned | port, | ||
| bool | reuse = false ) |
Bind the socket to the given local address and port.
| addr | |
| port |
Definition at line 1222 of file socket.cpp.
References IsValid().
| bool UdpServerSocket::Bind | ( | unsigned | port, |
| bool | reuse = false ) |
Bind the socket to the given port on any local addresses.
| port |
Definition at line 1157 of file socket.cpp.
References IsValid().
| bool UdpServerSocket::Create | ( | SOCKET_AF_t | af | ) |
Initialize the socket for the given protocol.
Definition at line 1128 of file socket.cpp.
References IsValid().
|
inline |
|
inline |
| std::string UdpServerSocket::GetRemoteAddrInfo | ( | ) | const |
Definition at line 1433 of file socket.cpp.
| bool UdpServerSocket::IsValid | ( | ) | const |
Definition at line 1152 of file socket.cpp.
Referenced by AwaitIncoming(), Bind(), Bind(), Create(), ReadData(), ReceiveData(), SetMulticastMembership(), and SetMulticastTTL().

| size_t UdpServerSocket::ReadData | ( | void * | buf, |
| size_t | n ) |
Read remaining data from the datagram buffer.
| buf | the pointer to write received data |
| n | the number of byte to read |
Definition at line 1441 of file socket.cpp.
References IsValid().
Referenced by ReceiveData().

|
inlinevirtual |
Await incoming then read data from the datagram buffer.
| buf | the pointer to write received data |
| n | the number of byte to read |
Implements NSROOT::NetSocket.
Definition at line 419 of file socket.h.
References AwaitIncoming(), IsValid(), and ReadData().
|
inlinevirtual |
| bool UdpServerSocket::SetMulticastMembership | ( | const char * | group, |
| bool | join ) |
Configure socket to join/leave the given multicast group.
| group | address name of the group |
| join | add/drop membership |
Definition at line 1334 of file socket.cpp.
References IsValid().
| bool UdpServerSocket::SetMulticastTTL | ( | int | multicastTTL | ) |
Configure hop limit value to be used for multicast packets on the opened socket.
| multicastTTL |
Definition at line 1295 of file socket.cpp.
References IsValid().
|
private |
|
private |