This class represents a socket for sending and receiving datagram packets.
More...
#include <datagramsocket.h>
Inherits ObjectImpl.
|
| DatagramSocket () |
| Constructs a datagram socket and binds it to any available port on the local host machine.
|
|
| DatagramSocket (int port) |
| Constructs a datagram socket and binds it to the specified port on the local host machine.
|
|
| DatagramSocket (int port, InetAddressPtr laddr) |
| Creates a datagram socket, bound to the specified local address.
|
|
| ~DatagramSocket () |
| ensure the socket is closed.
|
|
void | bind (int lport, InetAddressPtr laddress) |
| Binds a datagram socket to a local port and address.
|
|
void | create () |
| Creates a datagram socket.
|
|
void | close () |
| Closes this datagram socket.
|
|
void | connect (InetAddressPtr address, int port) |
| Connects the socket to a remote address for this socket.
|
|
InetAddressPtr | getInetAddress () const |
| Returns the address to which this socket is connected.
|
|
InetAddressPtr | getLocalAddress () const |
| Gets the local address to which the socket is bound.
|
|
int | getLocalPort () const |
| Returns the port number on the local host to which this socket is bound.
|
|
int | getPort () const |
| Returns the port for this socket.
|
|
bool | isBound () const |
| Returns the binding state of the socket.
|
|
bool | isClosed () const |
| Returns wether the socket is closed or not.
|
|
bool | isConnected () const |
| Returns the connection state of the socket.
|
|
void | receive (DatagramPacketPtr &p) |
| Receives a datagram packet from this socket.
|
|
void | send (DatagramPacketPtr &p) |
| Sends a datagram packet from this socket.
|
|
| ObjectImpl () |
|
virtual | ~ObjectImpl () |
|
void | addRef () const |
|
void | releaseRef () const |
|
virtual const helpers::Class & | getClass () const |
|
virtual | ~Object () |
|
virtual bool | instanceof (const Class &clazz) const =0 |
|
virtual const void * | cast (const Class &clazz) const =0 |
|
This class represents a socket for sending and receiving datagram packets.
◆ DatagramSocket() [1/3]
Constructs a datagram socket and binds it to any available port on the local host machine.
◆ DatagramSocket() [2/3]
Constructs a datagram socket and binds it to the specified port on the local host machine.
◆ DatagramSocket() [3/3]
Creates a datagram socket, bound to the specified local address.
◆ ~DatagramSocket()
ensure the socket is closed.
◆ bind()
void bind |
( |
int | lport, |
|
|
InetAddressPtr | laddress ) |
Binds a datagram socket to a local port and address.
◆ close()
Closes this datagram socket.
◆ connect()
void connect |
( |
InetAddressPtr | address, |
|
|
int | port ) |
Connects the socket to a remote address for this socket.
◆ create()
Creates a datagram socket.
◆ getInetAddress()
InetAddressPtr getInetAddress |
( |
| ) |
const |
|
inline |
Returns the address to which this socket is connected.
◆ getLocalAddress()
InetAddressPtr getLocalAddress |
( |
| ) |
const |
|
inline |
Gets the local address to which the socket is bound.
◆ getLocalPort()
int getLocalPort |
( |
| ) |
const |
|
inline |
Returns the port number on the local host to which this socket is bound.
◆ getPort()
Returns the port for this socket.
◆ isBound()
Returns the binding state of the socket.
◆ isClosed()
Returns wether the socket is closed or not.
◆ isConnected()
bool isConnected |
( |
| ) |
const |
|
inline |
Returns the connection state of the socket.
◆ receive()
void receive |
( |
DatagramPacketPtr & | p | ) |
|
Receives a datagram packet from this socket.
◆ send()
void send |
( |
DatagramPacketPtr & | p | ) |
|
Sends a datagram packet from this socket.
The documentation for this class was generated from the following file: