protected override void OnConnectionFailed(OnRemoteConnectionClosedInfo result)
        {
            if (_connectedEpicUsers.ContainsKey(result.RemoteUserId))
            {
                _connectedEpicUsers.Remove(result.RemoteUserId);
            }

            base.OnConnectionFailed(result);
        }
Exemple #2
0
        private void OnConnectFail(OnRemoteConnectionClosedInfo result)
        {
            if (ignoreAllMessages)
            {
                return;
            }

            OnConnectionFailed(result.RemoteUserId);

            switch (result.Reason)
            {
            case ConnectionClosedReason.ClosedByLocalUser:
                throw new Exception("Connection cLosed: The Connection was gracecfully closed by the local user.");

            case ConnectionClosedReason.ClosedByPeer:
                throw new Exception("Connection closed: The connection was gracefully closed by remote user.");

            case ConnectionClosedReason.ConnectionClosed:
                throw new Exception("Connection closed: The connection was unexpectedly closed.");

            case ConnectionClosedReason.ConnectionFailed:
                throw new Exception("Connection failed: Failled to establish connection.");

            case ConnectionClosedReason.InvalidData:
                throw new Exception("Connection failed: The remote user sent us invalid data..");

            case ConnectionClosedReason.InvalidMessage:
                throw new Exception("Connection failed: The remote user sent us an invalid message.");

            case ConnectionClosedReason.NegotiationFailed:
                throw new Exception("Connection failed: Negotiation failed.");

            case ConnectionClosedReason.TimedOut:
                throw new Exception("Connection failed: Timeout.");

            case ConnectionClosedReason.TooManyConnections:
                throw new Exception("Connection failed: Too many connections.");

            case ConnectionClosedReason.UnexpectedError:
                throw new Exception("Unexpected Error, connection will be closed");

            case ConnectionClosedReason.Unknown:
            default:
                throw new Exception("Unknown Error, connection has been closed.");
            }
        }
        /// <summary>
        ///     Overriding this to place cancellation token on connection failed here.
        /// </summary>
        /// <param name="result"></param>
        protected override void OnConnectionFailed(OnRemoteConnectionClosedInfo result)
        {
            base.OnConnectionFailed(result);

            Disconnect();
        }