Make ConnectionCallback static again.

This commit is contained in:
Ivan Derevyanko 2015-09-09 02:13:49 +02:00
parent 2b2943d5b0
commit ac77c11211
2 changed files with 5 additions and 4 deletions

View File

@ -50,15 +50,16 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
/// </summary> /// </summary>
protected abstract UvStreamHandle CreateListenSocket(string host, int port); protected abstract UvStreamHandle CreateListenSocket(string host, int port);
protected void ConnectionCallback(UvStreamHandle stream, int status, Exception error, object state) protected static void ConnectionCallback(UvStreamHandle stream, int status, Exception error, object state)
{ {
var listener = (Listener) state;
if (error != null) if (error != null)
{ {
Log.LogError("Listener.ConnectionCallback ", error); listener.Log.LogError("Listener.ConnectionCallback ", error);
} }
else else
{ {
((Listener)state).OnConnection(stream, status); listener.OnConnection(stream, status);
} }
} }

View File

@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Networking
Libuv.pipe_connect(this, pipe, name, _uv_connect_cb); Libuv.pipe_connect(this, pipe, name, _uv_connect_cb);
} }
private static void UvConnectCb(IntPtr ptr, int status) private static void UvConnectCb(IntPtr ptr, int status)
{ {
var req = FromIntPtr<UvConnectRequest>(ptr); var req = FromIntPtr<UvConnectRequest>(ptr);
req.Unpin(); req.Unpin();