Пример #1
0
        private MessageHost AcceptClient(TcpClient client)
        {
            var host = new MessageHost(client, messageRegistry);

            host.ThreadException += Host_OnThreadException;
            host.Stopped         += Host_Stopped;
            hostList.Add(host);
            return(host);
        }
Пример #2
0
        protected virtual void BeginOnConnectionReceived(MessageHost host)
        {
            if (ConnectionReceived == null)
            {
                return;
            }

            var args = new TcpConnectionReceivedEventArgs(host);

            ConnectionReceived?.BeginInvoke(this, args, EndOnConnectionReceived, args);
        }
Пример #3
0
        public TcpConnectionReceivedEventArgs(MessageHost host)
        {
            this.Host = host;

            Accept = true;
        }