コード例 #1
0
ファイル: SocketReceiver.cs プロジェクト: KennyDizi/IoFx
        public SocketReceiver(Socket socket, SocketFactory factory)
        {
            _factory = factory;
            _socket  = socket;
            Func <IObserver <ArraySegment <byte> >, Task <IDisposable> > loop = ReceiveLoop;

            _observable = Observable.Create(loop);
        }
コード例 #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);
        }