Mercurial > hg > ucis.core
changeset 45:8df7f4dc5615
HTTP Server: enable KeepAlive option on TCP sockets
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Wed, 12 Jun 2013 23:20:21 +0200 |
parents | 5a2b51b0d71b |
children | 053cc617af54 |
files | Net/HTTP.cs |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Net/HTTP.cs Wed Jun 12 23:08:48 2013 +0200 +++ b/Net/HTTP.cs Wed Jun 12 23:20:21 2013 +0200 @@ -60,6 +60,10 @@ if (Listener != null) Listener.Close(); } + public void HandleClient(Socket client) { + new HTTPContext(this, client); + } + bool TCPServer.IModule.Accept(TCPStream stream) { new HTTPContext(this, stream); return false; @@ -103,6 +107,7 @@ if (socket != null) { this.LocalEndPoint = socket.LocalEndPoint; this.RemoteEndPoint = socket.RemoteEndPoint; + if (socket.ProtocolType == ProtocolType.Tcp) socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true); if (stream == null) stream = new NetworkStream(socket, true); } Init(stream);