Apache Log4cxx Version 1.1.0
|
This class represents a socket for sending and receiving datagram packets. More...
#include <datagramsocket.h>
Public Member Functions | |
virtual | ~DatagramSocket () |
ensure the socket is closed. | |
virtual void | bind (int lport, InetAddressPtr laddress)=0 |
Binds a datagram socket to a local port and address. | |
virtual void | close () |
Closes this datagram socket. | |
virtual void | connect (InetAddressPtr address, int port)=0 |
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. | |
virtual bool | isClosed () const =0 |
Returns wether the socket is closed or not. | |
bool | isConnected () const |
Returns the connection state of the socket. | |
virtual void | receive (DatagramPacketPtr &p)=0 |
Receives a datagram packet from this socket. | |
virtual void | send (DatagramPacketPtr &p)=0 |
Sends a datagram packet from this socket. | |
![]() | |
virtual | ~Object () |
virtual const helpers::Class & | getClass () const =0 |
virtual bool | instanceof (const Class &clazz) const =0 |
virtual const void * | cast (const Class &clazz) const =0 |
Static Public Member Functions | |
static DatagramSocketUniquePtr | create () |
Constructs a datagram socket and binds it to any available port on the local host machine. | |
static DatagramSocketUniquePtr | create (int port) |
Constructs a datagram socket and binds it to the specified port on the local host machine. | |
static DatagramSocketUniquePtr | create (int port, InetAddressPtr laddr) |
Creates a datagram socket, bound to the specified local address. | |
Protected Member Functions | |
DatagramSocket (LOG4CXX_PRIVATE_PTR(DatagramSocketPriv) priv) | |
This class represents a socket for sending and receiving datagram packets.
|
protected |
|
virtual |
ensure the socket is closed.
|
pure virtual |
Binds a datagram socket to a local port and address.
|
pure virtual |
Connects the socket to a remote address for this socket.
|
static |
Constructs a datagram socket and binds it to any available port on the local host machine.
|
static |
Constructs a datagram socket and binds it to the specified port on the local host machine.
|
static |
Creates a datagram socket, bound to the specified local address.
InetAddressPtr log4cxx::helpers::DatagramSocket::getInetAddress | ( | ) | const |
Returns the address to which this socket is connected.
InetAddressPtr log4cxx::helpers::DatagramSocket::getLocalAddress | ( | ) | const |
Gets the local address to which the socket is bound.
int log4cxx::helpers::DatagramSocket::getLocalPort | ( | ) | const |
Returns the port number on the local host to which this socket is bound.
int log4cxx::helpers::DatagramSocket::getPort | ( | ) | const |
Returns the port for this socket.
bool log4cxx::helpers::DatagramSocket::isBound | ( | ) | const |
Returns the binding state of the socket.
Returns wether the socket is closed or not.
bool log4cxx::helpers::DatagramSocket::isConnected | ( | ) | const |
Returns the connection state of the socket.
|
pure virtual |
Receives a datagram packet from this socket.
|
pure virtual |
Sends a datagram packet from this socket.