Poco::Net

class TCPServerConnection

File Information

Library: Net
Package: TCPServer
Header: Poco/Net/TCPServerConnection.h

Description

The abstract base class for TCP server connections created by TCPServer.

Derived classes must override the run() method (inherited from Runnable). Furthermore, a TCPServerConnectionFactory must be provided for the subclass.

The run() method must perform the complete handling of the client connection. As soon as the run() method returns, the server connection object is destroyed and the connection is automatically closed.

A new TCPServerConnection object will be created for each new client connection that is accepted by TCPServer.

Inheritance

Direct Base Classes: Poco::Runnable

All Base Classes: Poco::Runnable

Known Derived Classes: HTTPServerConnection, Poco::RemotingNG::TCP::ServerConnection, Poco::OSP::Shell::ShellConnection

Member Summary

Member Functions: socket, start

Inherited Functions: run

Constructors

TCPServerConnection

TCPServerConnection(
    const StreamSocket & socket
);

Creates the TCPServerConnection using the given stream socket.

Destructor

~TCPServerConnection virtual

virtual ~TCPServerConnection();

Destroys the TCPServerConnection.

Member Functions

socket protected inline

StreamSocket & socket();

Returns a reference to the underlying socket.

start protected

void start();

Calls run() and catches any exceptions that might be thrown by run().

Securely control IoT edge devices from anywhere   Connect a Device