public ProtocolClient(ProtocolClientOptions clientOptions) { ClientOptions = clientOptions; socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.NoDelay = true; Setup(); }
public ProtocolClient(Socket socket, ProtocolClientOptions clientOptions) { this.socket = socket; ClientOptions = clientOptions; RemoteEndPoint = socket.RemoteEndPoint; Setup(); }
public void Dispose() { Close(); buffer = null; RemoteEndPoint = null; ClientOptions = null; payloadStream?.Dispose(); if (UserToken is IDisposable) { (UserToken as IDisposable).Dispose(); } else { UserToken = null; } UnsubscribeEvents(); }
public ProtocolServerOptions(ProtocolClientOptions clientOptions, EndPoint listenEndPoint, int maxConnectionQueue = 20) { ClientOptions = clientOptions; MaxConnectionQueue = maxConnectionQueue; ListenEndPoint = listenEndPoint; }