CommunicationPolicy for connected sockets. More...

#include <senf/Socket/CommunicationPolicy.hh>

Inheritance diagram for senf::ConnectedCommunicationPolicy:

Static Public Member Functions

template<class SPolicy >
static void listen (ServerSocketHandle< SPolicy > const &handle, unsigned backlog)
 Enable establishing new connections on the socket. More...
 
template<class SPolicy >
static int accept (ServerSocketHandle< SPolicy > const &handle, typename ServerSocketHandle< SPolicy >::Address &address)
 accept a new connection on the socket. More...
 
static int accept (FileHandle const &handle)
 accept a new connection on the socket. More...
 

Additional Inherited Members

- Public Member Functions inherited from senf::CommunicationPolicyBase
virtual ~CommunicationPolicyBase ()
 

Detailed Description

CommunicationPolicy for connected sockets.

The ConnectedCommunicationPolicy provides support for standard BSD socket API based connected communication. It provides the server side listen() and accept() members.

Definition at line 42 of file CommunicationPolicy.hh.

Member Function Documentation

◆ accept() [1/2]

template<class SPolicy >
static int senf::ConnectedCommunicationPolicy::accept ( ServerSocketHandle< SPolicy > const &  handle,
typename ServerSocketHandle< SPolicy >::Address &  address 
)
static

accept a new connection on the socket.

The accept() member will return a new client file descriptor. This file descriptor will be used by the ServerSocketHandle implementation to build a new ClientSocketHandle for the new connection.

Parameters
[in]handlesocket handle to accept connection on
[out]addressaddress of newly connected remote peer
Returns
file descriptor of new client socket

◆ accept() [2/2]

static int senf::ConnectedCommunicationPolicy::accept ( FileHandle const &  handle)
static

accept a new connection on the socket.

The accept() member will return a new client file descriptor. This file descriptor will be used by the ServerSocketHandle implementation to build a new ClientSocketHandle for the new connection.

Parameters
[in]handlesocket handle to accept connection on
Returns
file descriptor of new client socket

◆ listen()

template<class SPolicy >
static void senf::ConnectedCommunicationPolicy::listen ( ServerSocketHandle< SPolicy > const &  handle,
unsigned  backlog 
)
static

Enable establishing new connections on the socket.

Parameters
[in]handlesocket handle to enable reception on
[in]backlogsize of backlog queue

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