Beispiel #1
0
        public static SDKClient GetInstace()
        {
            if (instance_ == null)
            {
                instance_ = new SDKClient();
            }

            return(instance_);
        }
Beispiel #2
0
        private void Accept(IAsyncResult iar)
        {
            if (this.client_ != null)
            {
                this.client_.Close();
                this.client_ = null;
            }

            this.client_ = this.server_.EndAccept(iar);
            this.ShowMessage("一个客户端接入.");
            try
            {
                server_.BeginAccept(new AsyncCallback(Accept), server_);
            }
            catch (System.Exception e)
            {
                this.ShowMessage("监听端口号: " + this.port_ + " 失败.");
            }
            SDKClient.GetInstace().InitConnect(client_);
        }