Пример #1
0
        protected virtual void OnReceived(object sender, MalockInnetSocketStream e)
        {
            MalockNodeMessage message = null;

            using (Stream stream = e.Stream)
            {
                if (!MalockNodeMessage.TryDeserialize(e.Stream, out message))
                {
                    this.Abort();
                    return;
                }
                if (message.Command == MalockNodeMessage.SERVER_COMMAND_SYN_LOADALLINFO)
                {
                    this.LoadAllInfo(stream);
                }
                else if (message.Command == MalockNodeMessage.SERVER_COMMAND_SYN_ENTER)
                {
                    this.Enter(message);
                }
                else if (message.Command == MalockNodeMessage.SERVER_COMMAND_SYN_EXIT)
                {
                    this.Exit(message);
                }
            }
        }
Пример #2
0
        protected override void OnReceived(object sender, MalockSocketStream e)
        {
            MalockNnsMessage message = null;

            using (Stream stream = e.Stream)
            {
                if (!MalockNnsMessage.TryDeserialize(e.Stream, out message))
                {
                    this.Abort();
                    return;
                }
                if (message.Command == MalockNnsMessage.SERVER_NNS_COMMAND_DUMPHOSTENTRYINFO)
                {
                    this.DumpHostEntry(stream);
                }
            }
        }