Beispiel #1
0
        public UdpClient(ActionManagerBuilder builder, IUdpClientState state)
        {
            state.Client = this;
            _manager = builder.Build(state);

            Init(new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp));
        }
Beispiel #2
0
        private ActionManagerBuilder CreateBuilder(ConcurrentQueue<IPEndPoint> queue)
        {
            var builder = new ActionManagerBuilder();

            builder.AddAction(PacketType.Registration, new RegisterPacketAction(queue));
            builder.AddAction(PacketType.State, new DataPacketAction());
            builder.AddAction(PacketType.PacketAcceptResponse, new BigDataPacketAction(queue));

            return builder;
        }