/// <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); }); } }
/// <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(); } }
private void OnClientConnected(object sender, Shift.Network.TcpSocketNotificationEventArgs e) { }