|
Jpp
18.6.0-rc.1
the software that should make you happy
|
UDP socket. More...
#include <JUDPSocket.hh>
Public Member Functions | |
| JUDPSocket () | |
| Default constructor. More... | |
| JUDPSocket (const JHostname &hostname) | |
| Constructor. More... | |
| JUDPSocket (const int port) | |
| Constructor. More... | |
| int | read (char *buffer, const int length) override |
| Read data from socket. More... | |
| int | read (char *buffer, const int length, JUDPSocket &udp) |
| Read data from socket. More... | |
| virtual int | write (const char *buffer, const int length) override |
| Write data to socket. More... | |
| int | shutdown () |
| Shut down socket. More... | |
| void | setKeepAlive (const bool on) |
| Set keep alive of socket. More... | |
| bool | getKeepAlive () const |
| Get keep alive of socket. More... | |
| void | setReuseAddress (const bool on) |
| Set reuse address. More... | |
| bool | getReuseAddress () const |
| Get reuse address. More... | |
| void | setReceiveBufferSize (const int size) |
| Set receive buffer size. More... | |
| int | getReceiveBufferSize () const |
| Set receive buffer size. More... | |
| void | setSendBufferSize (const int size) |
| Set send buffer size. More... | |
| int | getSendBufferSize () const |
| Get send buffer size. More... | |
| int | close () |
| Close file. More... | |
| bool | in_avail (JTimeval timeout=JTimeval::min()) const |
| Check availability of input. More... | |
| bool | out_avail (JTimeval timeout=JTimeval::min()) const |
| Check availability of output. More... | |
| virtual bool | good () const |
| Check status. More... | |
| virtual bool | fail () const |
| Check status. More... | |
| virtual bool | bad () const |
| Check status. More... | |
| virtual bool | eof () const |
| Check end of file. More... | |
| bool | less (const JAbstractFile &file) const |
| Less than operation. More... | |
| int | getFileDescriptor () const |
| Get file descriptor. More... | |
| void | setFileDescriptor (const int file) |
| Set file descriptor. More... | |
| bool | is_open () const |
| Get open status. More... | |
| const sockaddr * | getSockaddr () const |
| Get sockaddr. More... | |
| sockaddr * | getSockaddr () |
| Get sockaddr. More... | |
| int | getFamily () const |
| Get family. More... | |
| void | setFamily (const int family) |
| Set family. More... | |
| std::string | getHostname () const |
| Get host name. More... | |
| int | getIPnumber () const |
| Get IP number. More... | |
| void | setIPnumber (const int ip_number) |
| Set IP number. More... | |
| void | setIPnumber () |
| Set any IP number. More... | |
| int | getPort () const |
| Get port number. More... | |
| void | setPort (const int port) |
| Set port number. More... | |
Static Public Member Functions | |
| static const int | getDefaultBufferSize () |
| Default socket buffer size to be used on this system. More... | |
| static int | sizeOf () |
| Get size of object. More... | |
Static Public Attributes | |
| static const int | FILE_CLOSED = -1 |
Protected Member Functions | |
| template<class T > | |
| void | setOption (const int level, const int option, const T value) |
| Set socket option. More... | |
| template<class T > | |
| T | getOption (const int level, const int option) const |
| Get socket option. More... | |
Protected Attributes | |
| int | fileDescriptor |
UDP socket.
Definition at line 25 of file JUDPSocket.hh.
|
inline |
|
inline |
Constructor.
UDP socket for client.
| hostname | host name of destination |
Definition at line 46 of file JUDPSocket.hh.
|
inline |
Constructor.
UDP socket for server.
| port | port number of receiver |
Definition at line 61 of file JUDPSocket.hh.
|
inlineoverridevirtual |
Read data from socket.
| buffer | buffer |
| length | number of bytes to read |
Reimplemented from JNET::JSocket.
Definition at line 81 of file JUDPSocket.hh.
|
inline |
Read data from socket.
| buffer | buffer |
| length | number of bytes to read |
| udp | UDP socket |
Definition at line 100 of file JUDPSocket.hh.
|
inlineoverridevirtual |
Write data to socket.
| buffer | buffer |
| length | number of bytes to write |
Reimplemented from JNET::JSocket.
Definition at line 122 of file JUDPSocket.hh.
|
inlinestaticinherited |
Default socket buffer size to be used on this system.
Definition at line 75 of file JSocket.hh.
|
inlineinherited |
Shut down socket.
Definition at line 89 of file JSocket.hh.
|
inlineinherited |
Set keep alive of socket.
| on | true to enable keep alive; false to disable |
Definition at line 104 of file JSocket.hh.
|
inlineinherited |
Get keep alive of socket.
Definition at line 115 of file JSocket.hh.
|
inlineinherited |
Set reuse address.
| on | true to enable reuse address; false to disable |
Definition at line 126 of file JSocket.hh.
|
inlineinherited |
Get reuse address.
Definition at line 137 of file JSocket.hh.
|
inlineinherited |
Set receive buffer size.
| size | number of bytes |
Definition at line 148 of file JSocket.hh.
|
inlineinherited |
|
inlineinherited |
Set send buffer size.
| size | number of bytes |
Definition at line 170 of file JSocket.hh.
|
inlineinherited |
|
inlineprotectedinherited |
Set socket option.
| level | level |
| option | option |
| value | value |
Definition at line 274 of file JSocket.hh.
|
inlineprotectedinherited |
Get socket option.
| level | level |
| option | option |
Definition at line 292 of file JSocket.hh.
|
inlineinherited |
|
inlineinherited |
Check availability of input.
This method returns true if at least one byte can be read without blocking.
| timeout | timeout |
Definition at line 106 of file JFile.hh.
|
inlineinherited |
Check availability of output.
This method returns true if at least one byte can be written without blocking.
| timeout | timeout |
Definition at line 119 of file JFile.hh.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Check status.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Check end of file.
|
inlineinherited |
Less than operation.
| file | JAbstractFile to be compared |
Definition at line 64 of file JAbstractFile.hh.
|
inlineinherited |
|
inlineinherited |
Set file descriptor.
| file | file descriptor |
Definition at line 86 of file JAbstractFile.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Get host name.
Definition at line 88 of file JSocketAddress.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Set any IP number.
Definition at line 119 of file JSocketAddress.hh.
|
inlineinherited |
|
inlineinherited |
Set port number.
| port | port number |
Definition at line 141 of file JSocketAddress.hh.
|
inlinestaticinherited |
|
staticinherited |
Definition at line 27 of file JAbstractFile.hh.
|
protectedinherited |
Definition at line 102 of file JAbstractFile.hh.
1.8.5