Reputation: 8127
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?
Upvotes: 2
Views: 2046
Reputation: 12266
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.
Upvotes: 5
Reputation: 35598
You are correct in your understanding of TCP, kind of. TCP provides a data stream to your application that you can write data to and it will arrive and arrive in order. That is, or course, assuming the connection doesn't die, which it can. I would suggest using a program like wireshark as Nikolai suggested to identify that the correct information is, in fact, being sent and to the proper address. I would then utilize wireshark on the server to assert the same things. Are there any characteristics of the connection Person B has that are different from Person A or yourself? (wireless, etc.)
Upvotes: 2
Reputation: 1620
Try to send messages (using your own protocol) to server from Person B with nc
If you can isolate the problem in client or server part of AS3 sockets, that would already be a major step.
Note: I used Actionscript3 sockets successfully on a project a few months back, only slightly tricky part was setting up the domain policy server properly.
A crazy idea: maybe recompile kernel with this option? Network packet drop alerting service (NET_DROP_MONITOR) Disclaimer: I have never tried this..
Upvotes: 1
Reputation: 84149
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.
Upvotes: 3