예제 #1
0
        /// <summary>
        /// Handles CommunicationChannelConnected event of _connectionListener object.
        ///
        /// </summary>
        /// <param name="sender">Source of event</param><param name="e">Event arguments</param>
        private void ConnectionListener_CommunicationChannelConnected(object sender, CommunicationChannelEventArgs e)
        {
            ScsServerClient scsServerClient = new ScsServerClient(e.Channel)
            {
                ClientId     = ScsServerManager.GetClientId(),
                WireProtocol = this.WireProtocolFactory.CreateWireProtocol()
            };

            scsServerClient.Disconnected          += new EventHandler(this.Client_Disconnected);
            this.Clients[scsServerClient.ClientId] = (IScsServerClient)scsServerClient;
            this.OnClientConnected((IScsServerClient)scsServerClient);
            e.Channel.Start();
        }
예제 #2
0
파일: ScsServerBase.cs 프로젝트: AS2805/6.3
        /// <summary>
        /// Handles CommunicationChannelConnected event of _connectionListener object.
        /// </summary>
        /// <param name="sender">Source of event</param>
        /// <param name="e">Event arguments</param>
        private void ConnectionListener_CommunicationChannelConnected(object sender, CommunicationChannelEventArgs e)
        {
            var client = new ScsServerClient(e.Channel)
            {
                ClientId     = ScsServerManager.GetClientId(),
                WireProtocol = WireProtocolFactory.CreateWireProtocol()
            };

            client.Disconnected     += Client_Disconnected;
            Clients[client.ClientId] = client;
            OnClientConnected(client);
            e.Channel.Start();
        }