コード例 #1
0
ファイル: Agent.cs プロジェクト: xibeilang524/scada-1
 public Agent(string serverAddress, int serverPort)
 {
     this.ServerAddress     = serverAddress;
     this.ServerPort        = serverPort;
     this.handler           = new MessageDataHandler(this);
     this.IsRetryConnection = true;
     this.ConnectRetryRoutine();
 }
コード例 #2
0
ファイル: Agent.cs プロジェクト: mrddos/planisphere
        // Callback for Wireless
        private void ConnectToWirelessCallback(IAsyncResult result)
        {
            if (result.IsCompleted)
            {
                try
                {
                    TcpClient client = (TcpClient)result.AsyncState;
                    client.EndConnect(result);
                    //client.
                    if (client.Connected)
                    {
                        this.stream = this.client.GetStream();
                        this.BeginRead(this.client);

                        this.handler = new MessageDataHandler(this);
                        // [Auth]
                        this.handler.SendAuthPacket();

                        this.OnNotifyEvent(this, NotifyEvent.Connected, "已连接");
                    }
                }
                catch (SocketException e)
                {
                    this.wirelessClient = null;
                    var s = e.Message;
                }

            }
        }
コード例 #3
0
ファイル: Agent.cs プロジェクト: oisy/scada
 public Agent(string serverAddress, int serverPort)
 {
     this.ServerAddress = serverAddress;
     this.ServerPort = serverPort;
     this.handler = new MessageDataHandler(this);
     this.IsRetryConnection = true;
     this.ConnectRetryRoutine();
 }