Ejemplo n.º 1
0
        /// <summary>
        /// </summary>
        /// <param name="client">
        /// </param>
        /// <param name="dataBytes">
        /// </param>
        private void ISComV2ServerDataReceived(ISComV2ClientHandler client, byte[] dataBytes)
        {
            if (this.DataReceived != null)
            {
                MessagePackSerializer <DynamicMessage> serializer = MessagePackSerializer.Create <DynamicMessage>();
                DynamicMessage result = serializer.UnpackSingleObject(dataBytes);

                this.DataReceived(client, result);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        protected override IClient CreateClient(IPAddress address)
        {
            IClient temp;

            lock (this.clients)
            {
                this.lastClientNumber++;
                temp = new ISComV2ClientHandler(this, this.bus, this.lastClientNumber);
                this.clients.Add(temp);
                ((ISComV2ClientHandler)temp).DataReceived += this.ISComV2ServerDataReceived;
            }

            return(temp);
        }
        /// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        protected override IClient CreateClient(IPAddress address)
        {
            IClient temp;
            lock (this.clients)
            {
                this.lastClientNumber++;
                temp = new ISComV2ClientHandler(this, this.bus, this.lastClientNumber);
                this.clients.Add(temp);
                ((ISComV2ClientHandler)temp).DataReceived += this.ISComV2ServerDataReceived;
            }

            return temp;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// </summary>
        /// <param name="client">
        /// </param>
        /// <param name="dataBytes">
        /// </param>
        private void ISComV2ServerDataReceived(ISComV2ClientHandler client, byte[] dataBytes)
        {
            if (this.DataReceived != null)
            {
                MessagePackSerializer<DynamicMessage> serializer = MessagePackSerializer.Create<DynamicMessage>();
                DynamicMessage result = serializer.UnpackSingleObject(dataBytes);

                this.DataReceived(client, result);
            }
        }