BaseHttpServerConnection

The base class for an incoming connection to a HTTP server, unassuming of transport.

Constructors

this
this(IConnection c)
Undocumented in source.

Members

Functions

acceptMore
bool acceptMore()

Accept more requests on the same connection?

closeResponse
void closeResponse()

Finalize writing the response. Headers and data should have already been sent. Low-level alternative to sendResponse.

debugLog
void debugLog(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
formatLocalAddress
string formatLocalAddress(HttpRequest r)
Undocumented in source.
logRequest
void logRequest(HttpRequest request, HttpResponse response)
Undocumented in source. Be warned that the author may not have intended to support it.
onContinuation
void onContinuation(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
onDisconnect
void onDisconnect(string reason, DisconnectType type)
Undocumented in source. Be warned that the author may not have intended to support it.
onNewRequest
void onNewRequest(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
processRequest
void processRequest(DataVec data)
Undocumented in source. Be warned that the author may not have intended to support it.
sendData
void sendData(Data[] data)

Send this data only. Headers should have already been sent. Low-level alternative to sendResponse.

sendHeaders
void sendHeaders(Headers headers, HttpStatusCode status, string statusMessage)
void sendHeaders(HttpResponse response)

Send these headers only. Low-level alternative to sendResponse.

sendResponse
void sendResponse(HttpResponse response)

Send the given HTTP response.

upgrade
Upgrade upgrade(HttpResponse response)

Switch protocols. If response is given, send that first. Then, release the connection and return it.

writeResponse
void writeResponse(HttpResponse response)

Send the given HTTP response, and do nothing else.

Properties

idle
bool idle [@property getter]

Idle connections are those which can be closed when the server is shutting down.

remoteAddressStr
HttpRequest remoteAddressStr [@property setter]

Retrieve the remote address of the peer, as a string.

Structs

Upgrade
struct Upgrade
Undocumented in source.

Variables

banner
string banner;
Undocumented in source.
conn
IConnection conn;

Connection used for this HTTP connection.

connected
bool connected;

Are we connected now?

currentRequest
HttpRequest currentRequest;

The current in-flight request.

expect
sizediff_t expect;
Undocumented in source.
firstRequest
bool firstRequest;
Undocumented in source.
handleRequest
void delegate(HttpRequest request) handleRequest;

Callback to handle a fully received request.

inBuffer
DataVec inBuffer;
Undocumented in source.
log
Logger log;

Optional HTTP log.

optimizeResponses
bool optimizeResponses;

Whether we should compress responses according to the request headers.

persistent
bool persistent;

Whether we will keep the connection open after the request is handled.

protocol
string protocol;
Undocumented in source.
requestProcessing
bool requestProcessing;
Undocumented in source.
responseSize
size_t responseSize;
Undocumented in source.
satisfyRangeRequests
bool satisfyRangeRequests;

Whether we should follow "Range" request headers.

timeout
Duration timeout;
Undocumented in source.
timeoutActive
bool timeoutActive;
Undocumented in source.
timer
TimeoutAdapter timer;

Time-out adapter.

Meta