Ejemplo n.º 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)
        {
            var client = new ScsServerClient(e.Channel)
            {
                ClientId = ScsServerManager.GetClientId(),
            };

            client.Disconnected     += Client_Disconnected;
            Clients[client.ClientId] = client;
            OnClientConnected(client);
            e.Channel.Start();
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handles CommunicationChannelConnected event of _connectionListener object.
        /// </summary>
        /// <param name="sender">Source of event</param>
        /// <param name="e">Event arguments</param>
        private void HandleCommunicationChannelConnected(object sender, CommunicationChannelEventArgs e)
        {
            var client = new ServerClient(e.Channel)
            {
                ClientId     = ServerManager.GetClientId(),
                WireProtocol = WireProtocolFactory.CreateWireProtocol()
            };

            client.Disconnected          += HandleClientDisconnected;
            this.Clients[client.ClientId] = client;
            this.OnClientConnected(client);
            e.Channel.Start();
        }
Ejemplo n.º 4
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)
        {
            var client = new NetworkClient(e.Channel)
            {
                ClientId     = ScsServerManager.GetClientId(),
                WireProtocol = WireProtocolFactory.CreateWireProtocol()
            };

            client.Disconnected     += Client_Disconnected;
            Clients[client.ClientId] = client;
            OnClientConnected(client);
            e.Channel.Start();
        }
Ejemplo n.º 5
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)
        {
            var client = new ScsServerClient(e.Channel)
            {
                ClientId     = ScsServerManager.GetClientId(((Lipi.Communication.Scs.Communication.EndPoints.Tcp.ScsTcpEndPoint)e.Channel.RemoteEndPoint).IpAddress),
                WireProtocol = WireProtocolFactory.CreateWireProtocol()
            };

            //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();
        }
Ejemplo n.º 6
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)
        {
            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();
        }