Пример #1
0
        internal RelayRequestState(SSUSession sess, Dictionary <IntroducerInfo, SSUSession> introducers) : base(sess)
        {
            if (!introducers.Any())
            {
                if (Session.RemoteEP != null)
                {
                    Logging.LogTransport($"SSU RelayRequestState {Session.DebugId} no established sessions to introducers. Trying direct connect.");
                    NextState = new SessionRequestState(Session, false);
                }
                else
                {
                    throw new FailedToConnectException($"SSU RelayRequestState {Session.DebugId} no established sessions to introducers");
                }
            }

            Introducers = introducers;

            foreach (var one in introducers)
            {
                Logging.LogTransport($"RelayRequestState {Session.DebugId} " +
                                     $"Trying {one.Key.EndPoint} to reach " +
                                     $"{Session.RemoteAddr.Options.TryGet( "host" )?.ToString() ?? Session.RemoteAddr.Options.ToString()}");
            }
            Session.Host.RelayResponseReceived += new SSUHost.RelayResponseInfo(Host_RelayResponseReceived);
        }
Пример #2
0
 public SessionConfirmedState(SSUSession sess, SessionRequestState req)
     : base(sess)
 {
     Request = req;
 }