Receiving messages in reversed order using TCP

Hi, I am using panda3d 1.7.2 on ubuntu 11 64.

Right now I am working on a client server application. I am using panda3d to handle collision and networking, and I am running into a pretty odd behavior.

On client I use:

self.cManager.openTCPClientConnection(self.address, self.port, 15000)

And on server:

		self.tcpSocket = self.cManager.openTCPServerRendezvous(self.port_address,self.backlog)

My main problem is that I am sending some messages at the server side and they arrive in reverse order at the client side.
This can be quite a problem considering I was assuming that, since it is a TCP connection, the messages would be ordered.
Is there any way I can force the messages to be ordered or any guarantee that the messages will always be received at reversed order?

Thanks in advance.

TCP does absolutely guarantee that messages are received in the same order they are sent. Since they appear to be received in a different order, it follows that something subtle is confusing you.


(a) you are mistaken about the order the messages are being sent, or
(b) you are mistaken about the order the messages are being received, or
© you are mistaken about sending messages via TCP and are actually using the UDP interface to send these messages (in spite of the fact that you have opened a TCP connection), or
(d) you actually have multiple TCP connections open and messages are being sent on both of them, or
(e) some other scenario that I can’t think of right now.