Jump to content
Sign in to follow this  
Fabry

UDP Recv is slow

Recommended Posts

Fabry

When I made a chat, I note that udprecv() slows down guigetmsg(), thus I click and then 1 second my click is polled. For resolving this problem I inserted this in my code.

$msg =guigetmsg()
; if nothing messages is received from gui or tray , receive udp data
    If $msg = 0  Then; it hurry up the program
        $data = UDPRecv($socket, 7000)
    EndIf

I hope it will be useful.


A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza รจ il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center]

Share this post


Link to post
Share on other sites
Pascal257

When I made a chat, I note that udprecv() slows down guigetmsg(), thus I click and then 1 second my click is polled. For resolving this problem I inserted this in my code.

$msg =guigetmsg()
; if nothing messages is received from gui or tray , receive udp data
    If $msg = 0  Then; it hurry up the program
        $data = UDPRecv($socket, 7000)
    EndIf

I hope it will be useful.

I don't think the problem is udprecv...

Your code after udprecv will cause 1 second waittime...

But you could also handle the udp process after the gui one.

It solves the problem too...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.