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 ¶meters) override¶ - See
kanzi::connect::ConnectionAdapter
-
void
listen
() override¶ Starts to listen for connections.
-
void
disconnect
(size_t clientId) 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
() override¶ Starts blocking loop that waits for work, should preserve resources & CPU.
-
void
work
() override¶ Performs all work that was received during the wait loop.
-
void
interrupt
() override¶ Allows to interrupt the wait loop and return from the blocking loop.
-
const string &
getConnectionType
() const override¶ Get the connection type identifier of this connection adapter.
- Return
string which identifies the connection type (e.g. “socket”)
-
unsigned int
getMaximumConnectionCount
() const override¶ Get maximum number of simultaneous connections for this adapters connection type.
- See
getConnectionType
-
const string
getRemoteIPAddress
(size_t handle) 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 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 communicationsocketType
: type of socket
-
~SocketConnectionAdapter
() override¶ Destructor.
-
int
getPort
() const¶
-
void