Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MinikPLayer

Pages: [1]
1
Network / Re: UDP packets queuing instead of skipping
« on: May 07, 2018, 01:39:42 pm »
Tried it on my laptop, and if i set to receive every 50ms, it gets the same as on PC. Also i have wireshark logs but don't know what to do with them :/

2
Network / Re: UDP packets queuing instead of skipping
« on: May 07, 2018, 12:12:42 pm »
Wireshark shows nothing on my local ip :/

3
Network / Re: UDP packets queuing instead of skipping
« on: May 05, 2018, 08:17:06 am »
Is it possible to ignore timestamp when receiving?

Sorry if i dont't understand, i'm not very advanced programmer :)

4
Network / UDP packets queuing instead of skipping
« on: May 04, 2018, 08:56:02 pm »
I'm trying to write a simple F1 2016 telemetry program. ( The game just sends some data through UDP and i'm trying to receive this data in SFML ). For that i'm trying to receive data every x miliseconds ( to decrease CPU usage ) and display it. The fault is, that if the game is running there is no enough CPU time and the receive app should skip some packets, but instead of doing that it's queuing packets and displaying it with a big delay which increase in time. The worst thing is that if i try to increase time between receive, delay is getting worse ( and if i set to receive every 0.5s it displays it every 0.5s, but the data.m_time shows that it's receiving every package, but i don't know why? The packages are sent by the game every ~1/60s ).

part of main.cpp:
sf::Time time;
sf::Clock clock;
UDPSocket socket;
socket.bind(port,ip);
socket.setBlocking(false);
F1datastruct data;  // It contains the variables that are used for data receiving
sf::Packet packet;

while (true)
        {
                packet.clear();
                time = clock.getElapsedTime(); 
                if (time.asMilliseconds() > 50)
                {
                        socket.receive(packet, ip, port);
                        packet >> data.m_time >> data.m_lapTime >> (...) >> data.m_vehicleFlags;
                        cout << endl;
                        cout << "Time: " << data.m_time << endl;
                        cout << "Lap time: " << data.m_lapTime << endl;
            clock.restart();
            time = clock.getElapsedTime();
        }
    }



 

Sorry for my bad english.


EDIT:
Trying to catch it on video:

Pages: [1]