# Poco::Net

# class TCPReactorServer

Library:
Package:
Header: Poco/Net/TCPReactorServer.h

## Description

This class implements a TCP server using the Reactor pattern. It uses a SocketReactor to handle incoming connections and dispatches them to TCPReactorServerConnection objects.

The TCPReactorServer is designed to be used with a SocketReactor and a TCPReactorAcceptor. The SocketReactor handles the event loop, while the TCPReactorAcceptor accepts incoming connections and creates TCPReactorServerConnection objects to handle them.

## Member Summary

Member Functions: setRecvMessageCallback, start, stop

## Constructors

### TCPReactorServer

TCPReactorServer(
int port,
TCPServerParams::Ptr pParams
);

## Destructor

### ~TCPReactorServer

~TCPReactorServer();

## Member Functions

### setRecvMessageCallback

void setRecvMessageCallback(
const RecvMessageCallback & cb
);

### start

void start();

Starts the TCPReactorServer. The server will listen for incoming connections on the given port.

### stop

void stop();