コード例 #1
0
ファイル: RelayRequestState.cs プロジェクト: itfenom/i2p-cs
        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;
 }