# Poco::Net

# class TCPServerConnectionFactory

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

## Description

A factory for TCPServerConnection objects.

The TCPServer class uses a TCPServerConnectionFactory to create a connection object for each new connection it accepts.

Subclasses must override the createConnection() method.

The TCPServerConnectionFactoryImpl template class can be used to automatically instantiate a TCPServerConnectionFactory for a given subclass of TCPServerConnection.

## Inheritance

Known Derived Classes: HTTPServerConnectionFactory, TCPServerConnectionFactoryImpl

## Member Summary

Member Functions: createConnection

## Types

### Ptr

typedef Poco::SharedPtr < TCPServerConnectionFactory > Ptr;

## Constructors

### TCPServerConnectionFactory

TCPServerConnectionFactory();

Creates the TCPServerConnectionFactory.

## Destructor

### ~TCPServerConnectionFactory

virtual ~TCPServerConnectionFactory();

Destroys the TCPServerConnectionFactory.

## Member Functions

### createConnection

virtual TCPServerConnection * createConnection(
const StreamSocket & socket
) = 0;

Creates an instance of a subclass of TCPServerConnection, using the given StreamSocket.