/// <summary> /// Creates a communication channel using ServerIpAddress and ServerPort. /// </summary> /// <returns>Ready communication channel to communicate</returns> protected override ICommunicationChannel CreateCommunicationChannel() { return(new TcpCommunicationChannel( TcpHelper.ConnectToServer( new IPEndPoint(IPAddress.Parse(_serverEndPoint.IpAddress), _serverEndPoint.TcpPort), ConnectTimeout ))); }
/// <summary> /// Creates a communication channel using ServerIpAddress and ServerPort. /// </summary> /// <returns>Ready communication channel to communicate</returns> protected override ICommunicationChannel CreateCommunicationChannel(params Tuple <SocketOptionLevel, SocketOptionName, object>[] socketOptions) { EndPoint endpoint = null; if (IsStringIp(_serverEndPoint.IpAddress)) { endpoint = new IPEndPoint(IPAddress.Parse(_serverEndPoint.IpAddress), _serverEndPoint.TcpPort); } else { endpoint = new DnsEndPoint(_serverEndPoint.IpAddress, _serverEndPoint.TcpPort); } return(new TcpCommunicationChannel(TcpHelper.ConnectToServer(endpoint, ConnectTimeout, socketOptions))); }
/// <summary> /// Creates a communication channel using ServerIpAddress and ServerPort. /// </summary> /// <returns>Ready communication channel to communicate</returns> protected override ICommunicationChannel CreateCommunicationChannel() { EndPoint endpoint = null; if (IsStringIp(_serverEndPoint.IpAddress)) { endpoint = new IPEndPoint(IPAddress.Parse(_serverEndPoint.IpAddress), _serverEndPoint.TcpPort); } else { endpoint = new DnsEndPoint(_serverEndPoint.IpAddress, _serverEndPoint.TcpPort); } return(new TcpCommunicationChannel( TcpHelper.ConnectToServer( endpoint, ConnectTimeout ))); }
/// <summary> /// Creates a communication channel using ServerIpAddress and ServerPort. /// </summary> /// <returns>Ready communication channel to communicate</returns> protected override ICommunicationChannel CreateCommunicationChannel() { EndPoint endpoint = null; if (IsStringIp(_serverEndPoint.IpAddress)) { endpoint = new IPEndPoint(IPAddress.Parse(_serverEndPoint.IpAddress), _serverEndPoint.TcpPort); } else { throw new System.NotSupportedException("DnsEndPoint нет в net 3.5. Используйте строковое представление ip. Возможно тут заменить на обычный IPEndPoint?"); //endpoint = new DnsEndPoint(_serverEndPoint.IpAddress, _serverEndPoint.TcpPort); } return(new TcpCommunicationChannel( TcpHelper.ConnectToServer( endpoint, ConnectTimeout ))); }