Ejemplo n.º 1
0
        public SocketReceiver(Socket socket, SocketFactory factory)
        {
            _factory = factory;
            _socket  = socket;
            Func <IObserver <ArraySegment <byte> >, Task <IDisposable> > loop = ReceiveLoop;

            _observable = Observable.Create(loop);
        }
Ejemplo n.º 2
0
        public SocketListener(Func <Socket> createFunc, SocketFactory awaitableFactory)
        {
            _createListenerFunc     = createFunc;
            _startTcs               = new TaskCompletionSource <Socket>();
            _socketAwaitableFactory = awaitableFactory;
            Func <IObserver <Socket>, Task <IDisposable> > loop = AcceptLoop;

            _observable = Observable.Create <Socket>(loop);
        }