Ejemplo n.º 1
0
        public ProudSession(uint hostId, IChannel channel, ProudServer server)
        {
            HostId         = hostId;
            Server         = server;
            Channel        = (ISocketChannel)channel;
            HandhsakeEvent = new AsyncManualResetEvent();
            ConnectDate    = DateTimeOffset.Now;
            var remoteEndPoint = (IPEndPoint)Channel.RemoteAddress;

            RemoteEndPoint = new IPEndPoint(remoteEndPoint.Address.MapToIPv4(), remoteEndPoint.Port);

            var localEndPoint = (IPEndPoint)Channel.LocalAddress;

            LocalEndPoint = new IPEndPoint(localEndPoint.Address.MapToIPv4(), localEndPoint.Port);

            Logger = Server.Configuration.Logger?
                     .ForContext("HostId", HostId)
                     .ForContext("EndPoint", remoteEndPoint.ToString());

            HandleLock = new MaxUseLock(4);
        }
Ejemplo n.º 2
0
 internal P2PGroupManager(ProudServer server)
 {
     _server = server;
 }
Ejemplo n.º 3
0
 public UdpSocket(ProudServer owner)
 {
     _owner = owner;
 }
Ejemplo n.º 4
0
 public ProudSession Create(uint hostId, IChannel channel, ProudServer server)
 {
     return(new ProudSession(hostId, channel, server));
 }
Ejemplo n.º 5
0
 internal P2PGroup(ProudServer server, bool allowDirectP2P)
 {
     _server        = server;
     HostId         = _server.Configuration.HostIdFactory.New();
     AllowDirectP2P = allowDirectP2P;
 }
Ejemplo n.º 6
0
 public UdpSocketManager(ProudServer server)
 {
     _server = server;
 }