Beispiel #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);
        }
Beispiel #2
0
 internal P2PGroupManager(ProudServer server)
 {
     _server = server;
 }
Beispiel #3
0
 public UdpSocket(ProudServer owner)
 {
     _owner = owner;
 }
 public ProudSession Create(uint hostId, IChannel channel, ProudServer server)
 {
     return(new ProudSession(hostId, channel, server));
 }
Beispiel #5
0
 internal P2PGroup(ProudServer server, bool allowDirectP2P)
 {
     _server        = server;
     HostId         = _server.Configuration.HostIdFactory.New();
     AllowDirectP2P = allowDirectP2P;
 }
 public UdpSocketManager(ProudServer server)
 {
     _server = server;
 }