private void OnSessionDisconnected(NetworkConnection connection)
        {
            this.IsServerConnected = false;
            LogWriteLine("Server connection disconnected.");

            SessionDisconnected?.Invoke(connection);
        }
Beispiel #2
0
 internal static void RaiseSessionDisconnectedEvent([NotNull] Player player, LeaveReason leaveReason)
 {
     if (player == null)
     {
         throw new ArgumentNullException(nameof(player));
     }
     SessionDisconnected?.Invoke(null, new SessionDisconnectedEventArgs(player, leaveReason));
 }
Beispiel #3
0
        /// <summary>
        /// Called on logout from the FIX session.
        /// </summary>
        /// <param name="sessionId">The session identifier.</param>
        public void OnLogout(SessionID sessionId)
        {
            var disconnected = new SessionDisconnected(
                this.Brokerage,
                sessionId.ToString(),
                this.guidFactory.Generate(),
                this.clock.TimeNow());

            this.messagingAdapter.SendToBus(disconnected, null, this.clock.TimeNow());

            this.Logger.LogDebug(LogId.Network, $"Disconnected from session {sessionId}");
        }
Beispiel #4
0
        private void OnMessage(SessionDisconnected message)
        {
            if (this.maintainConnection)
            {
                this.Logger.LogWarning(LogId.Network, $"Disconnected from session {message.SessionId}.");
            }
            else
            {
                this.Logger.LogInformation(LogId.Network, $"Disconnected from session {message.SessionId}.");
            }

            this.OnDisconnected();
        }
Beispiel #5
0
 /// <summary>
 /// Remove a session that is no longer connected.
 /// </summary>
 /// <param name="sessionId">ID of the session to remove</param>
 private void RemoveSession(string sessionId)
 {
     lock (Sessions)
     {
         if (Sessions.ContainsKey(sessionId))
         {
             var sess = Sessions[sessionId];
             SessionDisconnected?.Invoke(sess);
             sess.State?.OnLeaveState();
             sess.UnsubscribeToSystem();
             Sessions.Remove(sessionId);
         }
     }
 }
Beispiel #6
0
 public override void OnSessionDisconnected()
 {
     SessionDisconnected?.Invoke(this.session);
 }
 /// <summary>
 /// Notifies the client that the audio session has been disconnected.
 /// </summary>
 /// <param name="disconnectReason">The reason that the audio session was disconnected.</param>
 /// <returns>HRESULT</returns>
 int IAudioSessionEvents.OnSessionDisconnected(AudioSessionDisconnectReason disconnectReason)
 {
     SessionDisconnected?.Invoke(this, new AudioSessionDisconnectedEventArgs(disconnectReason));
     return(0);
 }
 private void OnDisconnected(DisconnectedReason reason)
 {
     SessionDisconnected?.RaiseEventSafe(this, reason, nameof(SessionDisconnected));
 }