HttpServerConnection

Standard TCP-based HTTP server connection.

Constructors

this
this(HttpServer server, TcpConnection tcp, IConnection c, string protocol)
Undocumented in source.

Members

Functions

acceptMore
bool acceptMore()
Undocumented in source. Be warned that the author may not have intended to support it.
formatLocalAddress
string formatLocalAddress(HttpRequest r)
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.

Mixins

__anonymous
mixin DListLink
Undocumented in source.

Properties

remoteAddressStr
HttpRequest remoteAddressStr [@property setter]

Retrieves the remote peer address, honoring remoteIPHeader if set.

Variables

localAddress
Address localAddress;

Cached local and remote addresses.

protocol
string protocol;
Undocumented in source.
remoteAddress
Address remoteAddress;

Cached local and remote addresses.

server
HttpServer server;

HttpServer owning this connection.

tcp
TcpConnection tcp;

The TCP transport.

Mixed In Members

__anonymous
mixin ListLink!true
Undocumented in source.

Inherited Members

From BaseHttpServerConnection

timer
TimeoutAdapter timer;

Time-out adapter.

conn
IConnection conn;

Connection used for this HTTP connection.

currentRequest
HttpRequest currentRequest;

The current in-flight request.

persistent
bool persistent;

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

connected
bool connected;

Are we connected now?

log
Logger log;

Optional HTTP log.

handleRequest
void delegate(HttpRequest request) handleRequest;

Callback to handle a fully received request.

inBuffer
DataVec inBuffer;
Undocumented in source.
expect
sizediff_t expect;
Undocumented in source.
responseSize
size_t responseSize;
Undocumented in source.
requestProcessing
bool requestProcessing;
Undocumented in source.
firstRequest
bool firstRequest;
Undocumented in source.
timeout
Duration timeout;
Undocumented in source.
timeoutActive
bool timeoutActive;
Undocumented in source.
banner
string banner;
Undocumented in source.
debugLog
void debugLog(Args args)
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.
onDisconnect
void onDisconnect(string reason, DisconnectType type)
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.
processRequest
void processRequest(DataVec data)
Undocumented in source. Be warned that the author may not have intended to support it.
logRequest
void logRequest(HttpRequest request, HttpResponse response)
Undocumented in source. Be warned that the author may not have intended to support it.
formatLocalAddress
string formatLocalAddress(HttpRequest r)
Undocumented in source.
idle
bool idle [@property getter]

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

sendResponse
void sendResponse(HttpResponse response)

Send the given HTTP response.

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

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

sendData
void sendData(Data[] data)

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

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.

remoteAddressStr
HttpRequest remoteAddressStr [@property setter]

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

Meta