|
| UdpSocket (size_t bufferSize) |
|
int | GetErrNo () const |
|
bool | SendData (const char *buf, size_t size) |
|
size_t | ReceiveData (void *buf, size_t n) |
|
bool | IsValid () const |
|
bool | Open (SOCKET_AF_t af, const char *target, unsigned port) |
|
bool | Open (SOCKET_AF_t af, bool broadcast=false) |
|
bool | SetAddress (const char *target, unsigned port) |
|
bool | SetMulticastTTL (int multicastTTL) |
|
std::string | GetRemoteAddrInfo () const |
|
net_socket_t | GetHandle () const |
|
void | SetTimeout (timeval timeout) |
|
|
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 |
|
Definition at line 224 of file socket.h.
◆ GetErrNo()
int NSROOT::UdpSocket::GetErrNo |
( |
| ) |
const |
|
inline |
- Returns
- the last error occuring on call
Definition at line 234 of file socket.h.
◆ GetHandle()
net_socket_t NSROOT::UdpSocket::GetHandle |
( |
| ) |
const |
|
inline |
- Returns
- the socket handle
Definition at line 298 of file socket.h.
◆ GetRemoteAddrInfo()
std::string UdpSocket::GetRemoteAddrInfo |
( |
| ) |
const |
- Returns
- the address string of the remote host
Definition at line 894 of file socket.cpp.
◆ IsValid()
bool UdpSocket::IsValid |
( |
| ) |
const |
- Returns
- true when socket is opened, else false
Definition at line 889 of file socket.cpp.
◆ Open() [1/2]
bool UdpSocket::Open |
( |
SOCKET_AF_t |
af, |
|
|
const char * |
target, |
|
|
unsigned |
port |
|
) |
| |
Open the socket and configure the given destination.
- Parameters
-
af | the protocol |
target | the address name of destination |
port | |
- Returns
- true on success, else false
Definition at line 686 of file socket.cpp.
◆ Open() [2/2]
bool UdpSocket::Open |
( |
SOCKET_AF_t |
af, |
|
|
bool |
broadcast = false |
|
) |
| |
Open the socket.
- Parameters
-
af | the protocol |
broadcast | enable broadcast permission |
- Returns
- true on success, else false
Definition at line 691 of file socket.cpp.
◆ ReceiveData()
size_t UdpSocket::ReceiveData |
( |
void * |
buf, |
|
|
size_t |
n |
|
) |
| |
|
virtual |
Read data from the socket.
- Parameters
-
buf | the pointer to write received data |
n | the number of byte to read |
- Returns
- the number of received byte
Implements NSROOT::NetSocket.
Definition at line 822 of file socket.cpp.
◆ SendData()
bool UdpSocket::SendData |
( |
const char * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Send data into the socket.
- Parameters
-
buf | the pointer to data |
size | the number of byte to send |
- Returns
- true when succeeded, else false
Implements NSROOT::NetSocket.
Definition at line 805 of file socket.cpp.
◆ SetAddress()
bool UdpSocket::SetAddress |
( |
const char * |
target, |
|
|
unsigned |
port |
|
) |
| |
Configure the destination.
- Parameters
-
target | the address name of destination |
port | |
- Returns
- true on success, else false
Definition at line 724 of file socket.cpp.
◆ SetMulticastTTL()
bool UdpSocket::SetMulticastTTL |
( |
int |
multicastTTL | ) |
|
Configure hop limit value to be used for multicast packets on the opened socket.
- Parameters
-
- Returns
- true on success, else false
Definition at line 766 of file socket.cpp.
The documentation for this class was generated from the following files:
- /home/jlb/src/janbar/PVR/cppmythlib/cppmyth/src/private/socket.h
- /home/jlb/src/janbar/PVR/cppmythlib/cppmyth/src/private/socket.cpp