public NetClient(PacketManager packetManager) { _packetManager = packetManager; _tcpNetClient = new TcpNetClient(); _udpNetClient = new UdpNetClient(); _tcpNetClient.RegisterOnConnect(OnConnect); _tcpNetClient.RegisterOnConnectFailed(OnConnectFailed); // Register the same function for both TCP and UDP receive callbacks _udpNetClient.RegisterOnReceive(OnReceiveData); }
public UdpUpdateManager(UdpNetClient udpNetClient) { _udpNetClient = udpNetClient; _sentQueue = new ConcurrentDictionary <ushort, Stopwatch>(); _sequenceNumber = 0; // TODO: is this a good initial value? _averageRtt = 0f; _currentSwitchTimeThreshold = 10000; _currentUpdatePacket = new ServerUpdatePacket(); _sendStopwatch = new Stopwatch(); _belowThresholdStopwatch = new Stopwatch(); _currentCongestionStopwatch = new Stopwatch(); }
public ClientUpdateManager(UdpNetClient udpNetClient) : base(udpNetClient.UdpClient) { }