# Poco::Net

# class HTTPServerConnection

Library: Net
Package: HTTPServer
Header: Poco/Net/HTTPServerConnection.h

## Description

This subclass of TCPServerConnection handles HTTP connections.

## Inheritance

Direct Base Classes: TCPServerConnection

All Base Classes: TCPServerConnection, Poco::Runnable

## Member Summary

Member Functions: onServerStopped, run, sendErrorResponse

Inherited Functions: run, socket, start

## Constructors

### HTTPServerConnection

HTTPServerConnection(
const StreamSocket & socket,
HTTPServerParams::Ptr pParams,
HTTPRequestHandlerFactory::Ptr pFactory
);

Creates the HTTPServerConnection.

## Destructor

### ~HTTPServerConnection

virtual ~HTTPServerConnection();

Destroys the HTTPServerConnection.

## Member Functions

### run

void run();

Handles all HTTP requests coming in.

See also: Poco::Runnable::run()

### onServerStopped

void onServerStopped(
const bool & abortCurrent
);

### sendErrorResponse

void sendErrorResponse(
HTTPServerSession & session,
HTTPResponse::HTTPStatus status
);