Пример #1
0
 protected PacketHandler(INetworkBootstrap networkBootstrap, IPacketHandlerRegistry packetHandlerRegistry,
                         IConnectionRegistry connectionRegistry, IConnection connection)
 {
     NetworkBootstrap      = networkBootstrap;
     PacketHandlerRegistry = packetHandlerRegistry;
     ConnectionRegistry    = connectionRegistry;
     Connection            = connection;
 }
Пример #2
0
 protected PacketInboundHandler(INetworkBootstrap networkBootstrap, IPacketRegistry packetRegistry,
                                IConnectionRegistry connectionRegistry, IPacketHandlerRegistry packetHandlerRegistry)
 {
     _networkBootstrap      = networkBootstrap ?? throw new ArgumentNullException(nameof(networkBootstrap));
     _packetRegistry        = packetRegistry ?? throw new ArgumentNullException(nameof(packetRegistry));
     _connectionRegistry    = connectionRegistry ?? throw new ArgumentNullException(nameof(connectionRegistry));
     _packetHandlerRegistry =
         packetHandlerRegistry ?? throw new ArgumentNullException(nameof(packetHandlerRegistry));
 }
Пример #3
0
 public DefaultBootstrap(BootstrapTypeEnum bootstrapType, TimeSpan packetHandlerTickingInterval,
                         IConnectionRegistry connectionRegistry       = null,
                         IPacketRegistry packetRegistry               = null,
                         IPacketHandlerRegistry packetHandlerRegistry = null, Type inboundHandlerType = null)
 {
     _inboundHandlerType = inboundHandlerType ?? typeof(DefaultPacketInboundHandler);
     if (!typeof(PacketInboundHandler).IsAssignableFrom(_inboundHandlerType))
     {
         throw new ArgumentException(
                   $"{_inboundHandlerType.FullName} is not assignable from {typeof(PacketInboundHandler).FullName}");
     }
     BootstrapType = bootstrapType;
     _packetHandlerTickingInterval = packetHandlerTickingInterval.TotalMilliseconds;
     ConnectionRegistry            = connectionRegistry ?? new DefaultConnectionRegistry();
     PacketRegistry        = packetRegistry ?? new DefaultPacketRegistry();
     PacketHandlerRegistry = packetHandlerRegistry ?? new DefaultPacketHandlerRegistry(this, ConnectionRegistry);
 }
 public DefaultPacketInboundHandler(INetworkBootstrap networkBootstrap, IPacketRegistry packetRegistry,
                                    IConnectionRegistry connectionRegistry, IPacketHandlerRegistry packetHandlerRegistry) : base(
         networkBootstrap, packetRegistry, connectionRegistry, packetHandlerRegistry)
 {
 }
Пример #5
0
 public PacketHandler(INetworkBootstrap networkBootstrap, IPacketHandlerRegistry packetHandlerRegistry,
                      IConnectionRegistry connectionRegistry, IConnection connection) : base(networkBootstrap,
                                                                                             packetHandlerRegistry, connectionRegistry, connection)
 {
 }