SocketConnectionAdapter

class kanzi::connect::SocketConnectionAdapter : public ConnectionAdapter

A class that implements connection adapter for TCP-IP transport type.

Unnamed Group

void configure (const ConnectionAdapter::Parameters &parameters) KZ_OVERRIDE

See

kanzi::connect::ConnectionAdapter

void listen () KZ_OVERRIDE

Starts to listen for connections.

void disconnect (size_t clientId) KZ_OVERRIDE

Terminates connection to given client.

If a file descriptor related to this client has been returned by the implementation then implementation must not closed the file descriptor. Instead it should mark the client disconnected and issue interrupt() call that will cause the disconnectPendingClients() to be invoked that can be used to close the file descriptors.

Parameters
  • clientId: Id of the client that will be disconnected.

void wait () KZ_OVERRIDE

Starts blocking loop that waits for work, should preserve resources & CPU.

void work () KZ_OVERRIDE

Performs all work that was received during the wait loop.

void interrupt () KZ_OVERRIDE

Allows to interrupt the wait loop and return from the blocking loop.

const string & getConnectionType () const KZ_OVERRIDE

Get the connection type identifier of this connection adapter.

Return

string which identifies the connection type (e.g. “socket”)

unsigned int getMaximumConnectionCount () const KZ_OVERRIDE

Get maximum number of simultaneous connections for this adapters connection type.

See

getConnectionType

const string getRemoteIPAddress (size_t handle) KZ_OVERRIDE

Gets the IP Address of the remote peer.

Return

IP address of the remote peer.

Parameters
  • handle: identifies the remote peer.

void getClientSideParameters (vector< ClientSideParameter > &outputList) const KZ_OVERRIDE

Get list of parameters on the client side that are user configurable.

Parameters
  • outputList: Contains the parameters

Public Functions

SocketConnectionAdapter(ClientIdManager &clientIdManager, int socketType)

Constructor.

Parameters
  • clientIdManager: entity used to allocate internal identifiers for communication

  • socketType: type of socket

~SocketConnectionAdapter () KZ_OVERRIDE

Destructor.

int getPort() const

Public Static Attributes

const string PARAMETER_HOST_PORT

Configuration parameter, the port number of the listening socket.

const string PARAMETER_INTERFACE_IP