Merge branch 'benaadams/delegates' into dev

This commit is contained in:
Stephen Halter 2015-11-04 14:21:13 -08:00
commit 272ce27c79
9 changed files with 13 additions and 12 deletions

View File

@ -3,10 +3,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Primitives;
using System.IO;
namespace Microsoft.AspNet.Server.Kestrel.Http
{
@ -94,7 +94,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
value = values[0];
return true;
}
value = String.Join(",", values);
value = string.Join(",", values.ToArray());
return true;
}

View File

@ -25,7 +25,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
var socket = new UvPipeHandle(Log);
socket.Init(Thread.Loop, false);
socket.Bind(ServerAddress.UnixPipePath);
socket.Listen(Constants.ListenBacklog, ConnectionCallback, this);
socket.Listen(Constants.ListenBacklog, (stream, status, error, state) => ConnectionCallback(stream, status, error, state), this);
return socket;
}

View File

@ -25,7 +25,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
var socket = new UvPipeHandle(Log);
socket.Init(Thread.Loop, false);
socket.Bind(ServerAddress.UnixPipePath);
socket.Listen(Constants.ListenBacklog, ConnectionCallback, this);
socket.Listen(Constants.ListenBacklog, (stream, status, error, state) => ConnectionCallback(stream, status, error, state), this);
return socket;
}

View File

@ -25,7 +25,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
socket.Init(Thread.Loop, Thread.QueueCloseHandle);
socket.NoDelay(NoDelay);
socket.Bind(ServerAddress);
socket.Listen(Constants.ListenBacklog, ConnectionCallback, this);
socket.Listen(Constants.ListenBacklog, (stream, status, error, state) => ConnectionCallback(stream, status, error, state), this);
return socket;
}

View File

@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
socket.Init(Thread.Loop, Thread.QueueCloseHandle);
socket.NoDelay(NoDelay);
socket.Bind(ServerAddress);
socket.Listen(Constants.ListenBacklog, ConnectionCallback, this);
socket.Listen(Constants.ListenBacklog, (stream, status, error, state) => ConnectionCallback(stream, status, error, state), this);
return socket;
}

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Networking
{
public class UvAsyncHandle : UvHandle
{
private static Libuv.uv_async_cb _uv_async_cb = AsyncCb;
private static Libuv.uv_async_cb _uv_async_cb = (handle) => AsyncCb(handle);
private Action _callback;
public UvAsyncHandle(IKestrelTrace logger) : base(logger)

View File

@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Networking
/// </summary>
public class UvConnectRequest : UvRequest
{
private readonly static Libuv.uv_connect_cb _uv_connect_cb = UvConnectCb;
private readonly static Libuv.uv_connect_cb _uv_connect_cb = (req, status) => UvConnectCb(req, status);
private Action<UvConnectRequest, int, Exception, object> _callback;
private object _state;

View File

@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Networking
{
public abstract class UvHandle : UvMemory
{
private static Libuv.uv_close_cb _destroyMemory = DestroyMemory;
private static Libuv.uv_close_cb _destroyMemory = (handle) => DestroyMemory(handle);
private Action<Action<IntPtr>, IntPtr> _queueCloseHandle;
protected UvHandle(IKestrelTrace logger) : base (logger)

View File

@ -10,9 +10,10 @@ namespace Microsoft.AspNet.Server.Kestrel.Networking
{
public abstract class UvStreamHandle : UvHandle
{
private readonly static Libuv.uv_connection_cb _uv_connection_cb = UvConnectionCb;
private readonly static Libuv.uv_alloc_cb _uv_alloc_cb = UvAllocCb;
private readonly static Libuv.uv_read_cb _uv_read_cb = UvReadCb;
private readonly static Libuv.uv_connection_cb _uv_connection_cb = (handle, status) => UvConnectionCb(handle, status);
// Ref and out lamda params must be explicitly typed
private readonly static Libuv.uv_alloc_cb _uv_alloc_cb = (IntPtr handle, int suggested_size, out Libuv.uv_buf_t buf) => UvAllocCb(handle, suggested_size, out buf);
private readonly static Libuv.uv_read_cb _uv_read_cb = (IntPtr handle, int status, ref Libuv.uv_buf_t buf) => UvReadCb(handle, status, ref buf);
public Action<UvStreamHandle, int, Exception, object> _listenCallback;
public object _listenState;