public SocketReceiver(Socket socket, SocketFactory factory) { _factory = factory; _socket = socket; Func <IObserver <ArraySegment <byte> >, Task <IDisposable> > loop = ReceiveLoop; _observable = Observable.Create(loop); }
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); }