public LibuvOutputConsumer( PipeReader pipe, LibuvThread thread, UvStreamHandle socket, string connectionId, ILibuvTrace log) { _pipe = pipe; _thread = thread; _socket = socket; _connectionId = connectionId; _log = log; }
public Task StartAsync( IEndPointInformation endPointInformation, LibuvThread thread) { EndPointInformation = endPointInformation; Thread = thread; return(Thread.PostAsync(listener => { listener.ListenSocket = listener.CreateListenSocket(); listener.ListenSocket.Listen(LibuvConstants.ListenBacklog, ConnectionCallback, listener); }, this)); }
public LibuvConnection(UvStreamHandle socket, ILibuvTrace log, LibuvThread thread, IPEndPoint remoteEndPoint, IPEndPoint localEndPoint) { _socket = socket; RemoteAddress = remoteEndPoint?.Address; RemotePort = remoteEndPoint?.Port ?? 0; LocalAddress = localEndPoint?.Address; LocalPort = localEndPoint?.Port ?? 0; ConnectionClosed = _connectionClosedTokenSource.Token; Log = log; Thread = thread; }
public Task StartAsync( string pipeName, byte[] pipeMessage, IEndPointInformation endPointInformation, LibuvThread thread) { _pipeName = pipeName; _pipeMessage = pipeMessage; _buf = thread.Loop.Libuv.buf_init(_ptr, 4); EndPointInformation = endPointInformation; Thread = thread; DispatchPipe = new UvPipeHandle(Log); var tcs = new TaskCompletionSource <int>(this, TaskCreationOptions.RunContinuationsAsynchronously); Thread.Post(StartCallback, tcs); return(tcs.Task); }
public async Task StartAsync( string pipeName, byte[] pipeMessage, IEndPointInformation endPointInformation, LibuvThread thread) { _pipeName = pipeName; _pipeMessage = pipeMessage; if (_fileCompletionInfoPtr == IntPtr.Zero) { var fileCompletionInfo = new FILE_COMPLETION_INFORMATION() { Key = IntPtr.Zero, Port = IntPtr.Zero }; _fileCompletionInfoPtr = Marshal.AllocHGlobal(Marshal.SizeOf(fileCompletionInfo)); Marshal.StructureToPtr(fileCompletionInfo, _fileCompletionInfoPtr, false); } await StartAsync(endPointInformation, thread).ConfigureAwait(false); await Thread.PostAsync(listener => listener.PostCallback(), this).ConfigureAwait(false); }
public WriteReqPool(LibuvThread thread, ILibuvTrace log) { _thread = thread; _log = log; }