Listens for incoming TCP/IP socket connections. More...

#include <tcp_listen.h>

+ Inheritance diagram for clan::TCPListen:

Public Member Functions

 TCPListen ()
 Create null object. More...
 
 TCPListen (const SocketName &endpoint, int backlog=5, bool reuse_address=true)
 Create a listening socket for the specified end point. More...
 
 ~TCPListen ()
 
TCPConnection accept (SocketName &end_point)
 Accept an incoming connection. More...
 
void close ()
 Stops listening for incoming messages and closes the socket. More...
 
bool is_null () const
 Returns true if it is a null object. More...
 

Protected Member Functions

SocketHandle * get_socket_handle () override
 

Detailed Description

Listens for incoming TCP/IP socket connections.

Constructor & Destructor Documentation

clan::TCPListen::TCPListen ( )

Create null object.

clan::TCPListen::TCPListen ( const SocketName endpoint,
int  backlog = 5,
bool  reuse_address = true 
)

Create a listening socket for the specified end point.

clan::TCPListen::~TCPListen ( )

Member Function Documentation

TCPConnection clan::TCPListen::accept ( SocketName end_point)

Accept an incoming connection.

Parameters
end_pointSocket name of the accepted peer
Returns
A TcpConnection for the accepted connection, or a null object if no incoming connections are available
void clan::TCPListen::close ( )

Stops listening for incoming messages and closes the socket.

SocketHandle* clan::TCPListen::get_socket_handle ( )
overrideprotectedvirtual

Implements clan::NetworkEvent.

bool clan::TCPListen::is_null ( ) const
inline

Returns true if it is a null object.


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