receiveRequest

Attempts to receive an HTTP request from the given socket.

receiveRequest
(
InputStream
OutputStream
)
(,,
InputStream inputStream
,
OutputStream outputStream
,
ref ubyte[] receiveBuffer
,
ref MsgParser!Msg requestParser
,
Logger logger = getLogger()
)
if (
isByteInputStream!InputStream &&
isByteOutputStream!OutputStream
)

Parameters

server HttpServer

The server that accepted the client socket.

clientSocket Socket

The underlying socket to the client.

inputStream InputStream

The input stream to use.

outputStream OutputStream

The output stream to use.

receiveBuffer ubyte[]

The raw buffer that is used to store data that was read.

requestParser MsgParser!Msg

The HTTP request parser.

logger Logger

A logger to use to write log messages.

Return Value

Type: Optional!HttpRequestContext

An optional request context. If null, then the client socket can be closed and no further action is required. Otherwise, it is a valid request context that can be handled using the server's configured handler.