# ServerConnectionFactory

<a id="serverconnectionfactory"></a>

# ServerConnectionFactory

```cpp
#include <icy/http/server.h>

class ServerConnectionFactory
```

[Defined in src/http/include/icy/http/server.h:207](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/server.h#L207)

Factory for creating per-socket [`ServerConnection`](https://auscaster.com/icey/docs/api-reference/icy-http-ServerConnection.md#serverconnection-1) and per-request [`ServerResponder`](https://auscaster.com/icey/docs/api-reference/icy-http-ServerResponder.md#serverresponder) objects.

## Public Methods

| Return | Name | Description |
|--------|------|-------------|
|  | [`ServerConnectionFactory`](#serverconnectionfactory-1)  | Defaulted constructor. |
|  | [`~ServerConnectionFactory`](#serverconnectionfactory-2) `virtual` | Defaulted destructor. |
| [`ServerConnection::Ptr`](https://auscaster.com/icey/docs/api-reference/icy-http-ServerConnection.md#ptr-18) | [`createConnection`](#createconnection-2) `virtual` `inline` | Creates the [`ServerConnection`](https://auscaster.com/icey/docs/api-reference/icy-http-ServerConnection.md#serverconnection-1) wrapper for an accepted TCP socket. |
| std::unique_ptr< [`ServerResponder`](https://auscaster.com/icey/docs/api-reference/icy-http-ServerResponder.md#serverresponder) > | [`createResponder`](#createresponder-1) `virtual` `inline` | Creates the responder for the current request on `connection`. |

---

<a id="serverconnectionfactory-1"></a>

### ServerConnectionFactory

```cpp
ServerConnectionFactory() = default
```

[Defined in src/http/include/icy/http/server.h:210](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/server.h#L210)

Defaulted constructor.

---

<a id="serverconnectionfactory-2"></a>

### ~ServerConnectionFactory

`virtual`

```cpp
virtual ~ServerConnectionFactory() = default
```

[Defined in src/http/include/icy/http/server.h:211](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/server.h#L211)

Defaulted destructor.

---

<a id="createconnection-2"></a>

### createConnection

`virtual` `inline`

```cpp
virtual inline ServerConnection::Ptr createConnection(Server & server, const net::TCPSocket::Ptr & socket)
```

[Defined in src/http/include/icy/http/server.h:214](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/server.h#L214)

Creates the [`ServerConnection`](https://auscaster.com/icey/docs/api-reference/icy-http-ServerConnection.md#serverconnection-1) wrapper for an accepted TCP socket.

---

<a id="createresponder-1"></a>

### createResponder

`virtual` `inline`

```cpp
virtual inline std::unique_ptr< ServerResponder > createResponder(ServerConnection & connection)
```

[Defined in src/http/include/icy/http/server.h:220](https://github.com/auscaster/icey/blob/main/src/http/include/icy/http/server.h#L220)

Creates the responder for the current request on `connection`.
