EpcTools
An event based multi-threaded C++ development framework.
Public Member Functions | Protected Member Functions | Friends | List of all members
PFCP::NodeSocket Class Reference

Encapsulates the UDP Socket functionality used to communicate with a PFCP peer. More...

#include <epfcp.h>

Inheritance diagram for PFCP::NodeSocket:
ESocket::UDP< TQueue, TMessage > ESocket::Base< TQueue, TMessage >

Public Member Functions

 NodeSocket ()
 Default constructor. More...
 
virtual ~NodeSocket ()
 Class destructor. More...
 
NodeSocketsetLocalNode (LocalNodeSPtr &ln)
 Assigns the LocalNode that this socket is associated with. More...
 
NodeSocketclearLocalNode ()
 Clears the assigned LocalNode. More...
 
- Public Member Functions inherited from ESocket::UDP< TQueue, TMessage >
 UDP (Thread< TQueue, TMessage > &thread, Int bufsize=2097152)
 Class constructor. More...
 
 UDP (Thread< TQueue, TMessage > &thread, UShort port, Int bufsize=2097152)
 Class constructor. More...
 
 UDP (Thread< TQueue, TMessage > &thread, cpStr ipaddr, UShort port, Int bufsize=2097152)
 Class constructor. More...
 
 UDP (Thread< TQueue, TMessage > &thread, Address &addr, Int bufsize=2097152)
 Class constructor. More...
 
virtual ~UDP ()
 Class destructor. More...
 
const AddressgetLocal ()
 Retrieves the local address for this socket. More...
 
EString getLocalAddress ()
 Retrieves the IP address for this socket. More...
 
UShort getLocalPort ()
 Retrieves the port for this socket. More...
 
UDPsetLocal (cpStr addr, UShort port)
 Assigns the socket address for this socket. More...
 
UDPsetLocal (const Address &addr)
 Assigns the socket address for this socket. More...
 
Void write (const Address &to, cpUChar src, Int len)
 Sends data to the specified recipient address. More...
 
Void write (const Address &from, const Address &to, cpUChar src, Int len)
 Sends data to the specified recipient address. More...
 
Bool getSending ()
 Retrieves indication if this socket is in the process of sending data. More...
 
Void bind (UShort port)
 Binds this socket to a local port and IPADDR_ANY. More...
 
Void bind (cpStr ipaddr, UShort port)
 Binds this socket to a local address. More...
 
Void bind (const Address &addr)
 Binds this socket to a local address. More...
 
Void disconnect ()
 Disconnects the socket. More...
 
- Public Member Functions inherited from ESocket::Base< TQueue, TMessage >
virtual ~Base ()
 Virtual class destructor. More...
 
Thread< TQueue, TMessage > & getThread ()
 Retrieves the socket thread that this socket is associated with. More...
 
SocketType getSocketType ()
 Retrieves the socket type. More...
 
Int getFamily ()
 Retrieves the address family. More...
 
Int getType ()
 Retrieves the socket type. More...
 
Int getProtocol ()
 Retrieves the protocol. More...
 
Int getError ()
 Retrieves the last error value. More...
 
cpStr getErrorDescription ()
 
Void close ()
 Closes this socket. More...
 
Int getHandle ()
 Retrieves the socket file handle. More...
 
cpStr getStateDescription (SocketState state)
 Retrieves the description of the connection state. More...
 

Protected Member Functions

Void onReceive (const ESocket::Address &src, const ESocket::Address &dst, cpUChar data, Int len)
 Called by the ESocket infrastructure when a UDP message is received. More...
 
Void onError ()
 Called by the ESocket infrastructure when an error has been detected on the socket. More...
 

Friends

class LocalNode
 

Detailed Description

Encapsulates the UDP Socket functionality used to communicate with a PFCP peer.

Constructor & Destructor Documentation

PFCP::NodeSocket::NodeSocket ( )

Default constructor.

PFCP::NodeSocket::~NodeSocket ( )
virtual

Class destructor.

Member Function Documentation

NodeSocket& PFCP::NodeSocket::clearLocalNode ( )
inline

Clears the assigned LocalNode.

Returns
a reference to this object.
Void PFCP::NodeSocket::onError ( )
protectedvirtual

Called by the ESocket infrastructure when an error has been detected on the socket.

Reimplemented from ESocket::UDP< TQueue, TMessage >.

Void PFCP::NodeSocket::onReceive ( const ESocket::Address src,
const ESocket::Address dst,
cpUChar  data,
Int  len 
)
protectedvirtual

Called by the ESocket infrastructure when a UDP message is received.

Parameters
srcthe originating message IP address.
dstthe destination (local) IP address where the message was received.
dataa pointer to the received data buffer.
lenthe number of bytes received (and present in the buffer).

Reimplemented from ESocket::UDP< TQueue, TMessage >.

NodeSocket& PFCP::NodeSocket::setLocalNode ( LocalNodeSPtr &  ln)
inline

Assigns the LocalNode that this socket is associated with.

Parameters
lna shared pointer to the LocalNode object.
Returns
a reference to this object.

Friends And Related Function Documentation

friend class LocalNode
friend

The documentation for this class was generated from the following files: