Пример #1
0
        /// <summary>
        /// An internal helper method to indirectly call the ConnectFailed event from outside.
        /// </summary>
        internal void OnConnectFailed(TcpSocketNotificationEventArgs e)
        {
            var handler = ConnectFailed;

            if (handler != null)
            {
                NetworkHost.Instance.QueueEvent(() =>
                {
                    handler(this, e);
                });
            }
        }
Пример #2
0
        /// <summary>
        /// An internal helper method to indirectly call the Connected event from outside.
        /// </summary>
        internal void OnConnected(TcpSocketNotificationEventArgs e)
        {
            var handler = Connected;

            if (handler != null)
            {
                NetworkHost.Instance.QueueEvent(() =>
                {
                    handler(this, e);
                    // Enter the read queue only after the connected event has been processed.
                    e.Socket.StartReadTask();
                });
            }
            else
            {
                e.Socket.StartReadTask();
            }
        }
Пример #3
0
 private void OnClientConnected(object sender, Shift.Network.TcpSocketNotificationEventArgs e)
 {
 }