public WriteBody ( byte data, int offset, int length ) : void | ||
data | byte | |
offset | int | |
length | int | |
리턴 | void |
public void WriteBody(byte[] data, int offset, int length)
{
try {
_socket.Send(data, offset, length, SocketFlags.None);
}
catch (SocketException) {
}
}
public override void FlushResponse(bool finalFlush) { if (_responseStatus == 404 && !_headersSent && finalFlush && _verb == "GET") { // attempt directory listing if (ProcessDirectoryListingRequest()) { return; } } _connectionPermission.Assert(); if (!_headersSent) { _connection.WriteHeaders(_responseStatus, _responseHeadersBuilder.ToString()); _headersSent = true; } for (int i = 0; i < _responseBodyBytes.Count; i++) { byte[] bytes = _responseBodyBytes[i]; _connection.WriteBody(bytes, 0, bytes.Length); } _responseBodyBytes = new List<byte[]>(); if (finalFlush) { _connection.Close(); } }