예제 #1
0
        public virtual void Init(UvThread thread)
        {
#if DEBUG
            // Store weak handles to all UvRequest objects so we can do leak detection
            // while running tests
            thread.Requests.Add(new WeakReference(this));
#endif
        }
예제 #2
0
 public UvListenerPrimary(UvThread thread, IEndPointInformation endpoint, ILibuvTrace log = null)
     : base(thread, endpoint, log)
 {
     _dispatchPipes = new List <UvPipeHandle>();
     _createdPipes  = new List <UvPipeHandle>();
     _dummyMessage  = new ArraySegment <ArraySegment <byte> >(new[] {
         new ArraySegment <byte>(new byte[] { 1, 2, 3, 4 })
     });
 }
예제 #3
0
        public UvConnection(UvStreamHandle socket,
                            UvThread thread,
                            IPEndPoint remoteEndPoint, IPEndPoint localEndPoint,
                            PipeOptions sendPipeOptions = null, PipeOptions receivePipeOptions = null,
                            string name     = null,
                            ILibuvTrace log = null)
        {
            _socket = socket;

            RemoteAddress = remoteEndPoint?.Address;
            RemotePort    = remoteEndPoint?.Port ?? 0;

            LocalAddress = localEndPoint?.Address;
            LocalPort    = localEndPoint?.Port ?? 0;

            _sendToUV      = new Pipe(sendPipeOptions ?? PipeOptions.Default);
            _receiveFromUV = new Pipe(receivePipeOptions ?? PipeOptions.Default);
            _input         = _receiveFromUV.Reader;
            _output        = _sendToUV.Writer;

            ConnectionClosed = _connectionClosedTokenSource.Token;
            Log    = log;
            Thread = thread;
        }
예제 #4
0
 public UvListenerSecondary(UvThread thread, ILibuvTrace log = null)
 {
     Log     = log;
     _thread = thread;
     _ptr    = Marshal.AllocHGlobal(4);
 }
예제 #5
0
        public override void Init(UvThread thread)
        {
            DangerousInit(thread.Loop);

            base.Init(thread);
        }
예제 #6
0
 public WriteReqPool(UvThread thread, ILibuvTrace log)
 {
     _thread = thread;
     _log    = log;
 }
예제 #7
0
 public UvListener(UvThread thread, IEndPointInformation endpoint, ILibuvTrace log = null)
 {
     Thread = thread;
     EndPointInformation = endpoint;
     Log = log;
 }