Exemplo n.º 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
        }
Exemplo n.º 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 })
     });
 }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
 public UvListenerSecondary(UvThread thread, ILibuvTrace log = null)
 {
     Log     = log;
     _thread = thread;
     _ptr    = Marshal.AllocHGlobal(4);
 }
Exemplo n.º 5
0
        public override void Init(UvThread thread)
        {
            DangerousInit(thread.Loop);

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