internal ClientSocket(Socket socket, OnConnectionStateChangedHandler connectionStateChanged, OnSocketShutdownHandler shutdown, OnSendFinishedHandler sendfinished, OnDataReceivedHandler dataReceive ) : base(ClientSocketConfiguration.FromSocket(socket)) { _socket = socket ?? throw new ArgumentNullException(nameof(socket)); OnConnectionStateChanged += connectionStateChanged; OnSocketShutdown += shutdown; OnSendFinished += sendfinished; OnRawDataReceived += dataReceive; Task.Factory.StartNew(() => { PublishConnectionStateChanged(true); StartReceive(); }, TaskCreationOptions.LongRunning); }
public ClientSocket(ClientSocketConfiguration configuration) : base(configuration) { _config = configuration; }
public ClientSocket(ClientSocketConfiguration configuration) : base(configuration) { Init(); }
public ClientSocket(ClientSocketConfiguration configuration, ILoggerFactory loggerFactory) : base(configuration, loggerFactory?.CreateLogger <ClientSocket>()) => _config = configuration;