Example #1
0
 private void ExecuteBeginConnectDelegate(bool connectFailed)
 {
     this.m_bundleInfo = null;
     if (this.m_beginConnectDelegate != null)
     {
         bool isEncrypted = false;
         bool isSigned    = false;
         if (this.m_sslStream != null)
         {
             isEncrypted = this.m_sslStream.IsEncrypted;
             isSigned    = this.m_sslStream.IsSigned;
         }
         this.m_beginConnectDelegate(connectFailed, isEncrypted, isSigned);
         this.m_beginConnectDelegate = null;
         object[] args = new object[] { !connectFailed, isEncrypted, isSigned };
         s_log.LogDebug("Connected={0} isEncrypted={1} isSigned={2}", args);
     }
 }
Example #2
0
 public void Connect(string host, int port)
 {
     this.m_hostAddress = host;
     this.m_hostPort    = port;
     this.Disconnect();
     this.m_sslSocket       = new SslSocket();
     this.m_connectionState = ConnectionState.Connecting;
     try
     {
         this.m_sslSocket.BeginConnect(host, port, this.m_bundleInfo, new SslSocket.BeginConnectDelegate(this.ConnectCallback));
     }
     catch (Exception exception)
     {
         Debug.LogWarning("Could not connect to " + (this.m_hostAddress + ":" + this.m_hostPort) + " -- " + exception.Message);
         this.m_connectionState = ConnectionState.ConnectionFailed;
         this.TriggerOnConnectandler(BattleNetErrors.ERROR_RPC_PEER_UNKNOWN);
     }
     this.m_bundleInfo = null;
 }
Example #3
0
 public void BeginConnect(string address, int port, SslCertBundleInfo bundleInfo, BeginConnectDelegate connectDelegate)
 {
     try
     {
         string str;
         string str2;
         try
         {
             UriUtils.GetHostAddress(address, out str);
         }
         catch (Exception exception)
         {
             s_log.LogError("Exception within GetHostAddress: " + exception.Message);
             return;
         }
         this.m_address = address;
         if (UriUtils.GetHostAddressAsIp(address, out str2))
         {
             this.m_address = "::ffff:" + address;
         }
         this.m_resolvedAddress = "::ffff:" + str;
         object[] args = new object[] { str, port };
         s_log.LogDebug("Connecting to {0}:{1}", args);
         IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(str), port);
         this.m_beginConnectDelegate = connectDelegate;
         this.m_bundleInfo           = bundleInfo;
         this.m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
         this.m_socket.BeginConnect(remoteEP, new AsyncCallback(this.ConnectCallback), address);
     }
     catch (Exception exception2)
     {
         object[] objArray2 = new object[] { exception2 };
         s_log.LogWarning("Exception while trying to call BeginConnect. {0}", objArray2);
         this.ExecuteBeginConnectDelegate(true);
     }
 }
Example #4
0
 public SslClientConnection(SslCertBundleInfo bundleInfo)
 {
     this.m_bundleInfo = bundleInfo;
 }