コード例 #1
0
        public void Connect()
        {
            for (int i = 0; i < MaxConnections; i++)
            {
                var packet = new Packets.ClientPacket();
                packet.Options = Options;
                AsyncTcpClient client;
                if (mSslServerName == null)
                {
                    client = BeetleX.SocketFactory.CreateClient <BeetleX.Clients.AsyncTcpClient>(

                        packet, Host, Port);
                }
                else
                {
                    client = BeetleX.SocketFactory.CreateSslClient <BeetleX.Clients.AsyncTcpClient>(

                        packet, Host, Port, mSslServerName);
                }
                client.PacketReceive = OnPacketCompleted;
                client.ClientError   = (c, e) =>
                {
                    NetError?.Invoke(c, e);
                };
                mClients.Add(client);
            }
        }
コード例 #2
0
 private void RaiseOtherException(AsyncSocketState state)
 {
     if (NetError != null)
     {
         NetError.Invoke(this, new AsyncSocketEventArgs(state));
     }
 }
コード例 #3
0
ファイル: XRPCClient.cs プロジェクト: lanicon/XRPC
 private void OnError(IClient client, ClientErrorArgs e)
 {
     try
     {
         NetError.Invoke(client, e);
     }
     catch
     {
     }
 }
コード例 #4
0
 /// <summary>
 /// 触发网络错误事件
 /// </summary>
 /// <param name="state"></param>
 private void RaiseNetError(AsyncUDPState state, Exception exception)
 {
     NetError?.Invoke(this, new ScadaUDPEventArgs(exception, state));
 }
コード例 #5
0
 /// <summary>
 /// 触发网络错误事件
 /// </summary>
 /// <param name="state"></param>
 private void RaiseNetError(AsyncSocketState state)
 {
     NetError?.Invoke(this, new AsyncSocketEventArgs(state));
 }