Beispiel #1
0
        /// <summary>
        /// TBD
        /// </summary>
        public UdpConnection(UdpConnectedExt udp, IActorRef commander, Connect connect)
        {
            Udp        = udp;
            _commander = commander;
            _connect   = connect;

            Context.Watch(connect.Handler);

            if (connect.RemoteAddress is DnsEndPoint remoteAddress)
            {
                var resolved = Dns.ResolveName(remoteAddress.Host, Context.System, Self);
                if (resolved != null)
                {
                    DoConnect(new IPEndPoint(resolved.Addr, remoteAddress.Port));
                }
                else
                {
                    Context.Become(Resolving(remoteAddress));
                }
            }
            else
            {
                DoConnect(_connect.RemoteAddress);
            }
        }
Beispiel #2
0
        public UdpConnection(UdpConnectedExt udpConn,
                             IChannelRegistry channelRegistry,
                             IActorRef commander,
                             UdpConnected.Connect connect)
        {
            _udpConn         = udpConn;
            _channelRegistry = channelRegistry;
            _commander       = commander;
            _connect         = connect;

            Context.Watch(connect.Handler);

            var remoteAddress = connect.RemoteAddress as DnsEndPoint;

            if (remoteAddress != null)
            {
                var resolved = Dns.ResolveName(remoteAddress.Host, Context.System, Self);
                if (resolved != null)
                {
                    DoConnect(new IPEndPoint(resolved.Addr, remoteAddress.Port));
                }
                else
                {
                    Context.Become(Resolving(remoteAddress));
                }
            }
            else
            {
                DoConnect(_connect.RemoteAddress);
            }
        }
Beispiel #3
0
 public UdpConnectedManager(UdpConnectedExt udpConn)
     : base(udpConn.Settings, udpConn.Settings.NrOfSelectors)
 {
     _udpConn = udpConn;
 }
Beispiel #4
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="udpConn">TBD</param>
 public UdpConnectedManager(UdpConnectedExt udpConn)
 {
     _udpConn = udpConn;
 }
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="udpConn">TBD</param>
 public UdpConnectedManager(UdpConnectedExt udpConn)
 {
     _udpConn = udpConn;
     Context.System.EventStream.Subscribe(Self, typeof(DeadLetter));
 }