I still suspect the problem with your code is that you have a Delay(1) somewhere that triggers even if NetworkServerEvent() or WindowEvent() returns something else than 0. Removing that should fix the performance problem. (Or you may have a delay in the sending code, though that should be more obvious to spot.)
Alternatively, it may be easier and more reliable to put the networking code in a thread. That way there may be less clutter. In my opinion all network code should go in a thread because if it takes longer than normal (may happen on network failures) the user interface won't hang.
ReceiveNetworkData issue
After all I have found a misstake, you are right Trond! a delay(1) is in between spaghetties. Simplifying:
If I delete Delay (1) I obtain a 100% used CPU but with below code (simplified) all seems ok:
Thanks to all for your help, please forgive me for this stupid post...
Next step increase the length of data send up to MTU length, compressing and crypting streams and put the networking routines inside in a thread. Job for a while.
Thks again Trond, Mahan and Thalius![/quote]
Code: Select all
Repeat
EventServer = NetworkServerEvent()
If EventServer
Select EventoServidor
...
EndSelect
EndIf
Delay(1)
Until Quit = 1
Code: Select all
Repeat
EventServer = NetworkServerEvent()
If EventServer
Select EventoServidor
...
EndSelect
Else
Delay(1)
EndIf
Until Quit = 1
Next step increase the length of data send up to MTU length, compressing and crypting streams and put the networking routines inside in a thread. Job for a while.
Thks again Trond, Mahan and Thalius![/quote]