Real time multiplayer/xmlSocket

Im trying to create a real time multiplayer game similar to “Stick Arena”. Ive already created a nio java server which works wonderfully. Everything connects and works ok however the problem im facing is efficency. When I test the game on my lan network, there is a delay of about 200 ms. When the game is tested ona single computer everything gets sent without any significant delay (1ms~). Whats wrong?

To be more descriptive, the messages are received by the server instantly (1ms~) however its the flash xmlsocket.onData thats blocking in my opinion. Please reply any suggestions…

perhaps it is how often you read from your data are you using an onEnterFrame to read the data from the server or a setInterval?

The onData is a function hence its called whenever data arrives. Its not under any other restriction like on enter frame

when testing on the single machine… use the ip address of the machine in lan not local host… and then tell if the delay exists .

Thats what Ive been using all along (I never tried testing it using localhost as ip).
Thanks for your responses so far, always appreciate it when people post their suggestions. I have not solved the problem yet though :frowning:

I discovered one more thing. When I move characters in the game on both computers simultaneously the delay disappears and everything works fine… I thought it might have been the fault of the java server that I wrote however I wrote another server using winsock/c++ and everything behaves the same way.

Please, dont hesitate to post any ideas.

I can tell you right now that whatever the problem is its not with flash.
The fact that your getting such a long delay on your local network shows theres something terribly wrong with how your designing your server.
You need to see how long its taking complete packets to be received on the serverside end because thats where the problem is occurring.