/// <summary> /// Creates a SockNet client with an endpoint and a buffer pool /// </summary> /// <param name="endpoint"></param> /// <param name="bufferPool"></param> public ClientSockNetChannel(IPEndPoint endpoint, ObjectPool <byte[]> bufferPool, SockNetChannelProtocol protocol = SockNetChannelProtocol.Tcp) : base(new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp), bufferPool) { this.connectEndpoint = endpoint; this.State = ClientSockNetChannelState.Disconnected; }
/// <summary> /// Creates a socknet client that can connect to the given address and port using the given buffer pool. /// </summary> /// <param name="address"></param> /// <param name="port"></param> /// <param name="bufferPool"></param> public ClientSockNetChannel(IPAddress address, int port, ObjectPool <byte[]> bufferPool, SockNetChannelProtocol protocol = SockNetChannelProtocol.Tcp) : this(new IPEndPoint(address, port), bufferPool, protocol) { }