Пример #1
0
 internal RxSocketServer(Socket socket, ILogger logger)
 {
     Logger           = logger;
     Disposer         = new SocketDisposer(socket, logger);
     AcceptObservable = CreateAcceptObservable(socket);
     Logger.LogTrace("RxSocketServer Constructed.");
 }
Пример #2
0
 internal RxSocketClient(Socket connectedSocket, ILogger logger)
 {
     Socket            = connectedSocket.Connected ? connectedSocket : throw new SocketException((int)SocketError.NotConnected);
     Logger            = logger;
     Disposer          = new SocketDisposer(connectedSocket, logger);
     ReceiveObservable = CreateReceiveObservable();
     Logger.LogTrace("RxSocketClient Constructed.");
 }
Пример #3
0
 internal RxSocketClient(Socket connectedSocket, bool isAcceptSocket, ILogger logger)
 {
     Socket = connectedSocket;
     Name   = $"{(isAcceptSocket ? "Accepted " : "")}RxSocketClient";
     Logger = logger;
     Logger.LogDebug($"{Name} created on {Socket.LocalEndPoint} connected to {Socket.RemoteEndPoint}.");
     Disposer     = new SocketDisposer(connectedSocket, Name, logger);
     SocketReader = new SocketReader(connectedSocket, Name, Cts.Token, logger);
 }