Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Actionscript TCP Socket failing to send message for some people

I've written a socket server which communicates with my actionscript 3 flash game using the Socket class. This is a TCP connection, which I thought would mean that it is 100% sure that the sending message will be received by the server as this is done low-level. So, if it would fail to send it would resend the message.

This does seem to be the case for me and for two other people I've tested my build with. However, with one person, sometimes (rare but not ignoreable) the message is not being received by the server even though this does not seem to happen for other people their systems. This person however never has any problems with other professional multiplayer games, which means that it must be an issue with my build.

Is there anything that I can do to make sure that the message is being send correctly, and am I wrong about TCP being 100% secure because messages are supposed to be resend on failure low-level?

like image 338
Tom Avatar asked Dec 07 '25 08:12

Tom


2 Answers

You're right that this is a common problem, but the problem is a general one, independent of flash. I sent a message but it was never received, what should I do? You need to check that your client code really did send the message; you need to check that the message left the client machine; you need to check that the message reached the server machine; and you need to check that the server application received the message. You'll also want to make sure that your connection/socket between the client and the server is still alive.

In trying to diagnose this problem, assuming that TCP failed is the wrong place to start. If you're using UDP, then the story is different because UDP does not guarantee delivery (but you already knew that, right?).

Repeating previous suggestions, you should use Wireshark (or equivalent) to determine if the message leaves the client machine. You can start on your server, to make sure that nothing funny is happening there; however, if there is really no trace of the message on the server side, then you'll need to provide some kind of client-side instrumentation to see what's going on over there.

like image 137
jdigital Avatar answered Dec 10 '25 01:12

jdigital


You can always play with tcpdump or wireshark to see what is going on on the wire. Event if your problem is not at the TCP/IP level, these are too useful network troubleshooting tools not to learn.

like image 44
Nikolai Fetissov Avatar answered Dec 10 '25 01:12

Nikolai Fetissov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!