easyTcpSocket questions...

I have a few ‘beginner’ questions regarding the TCP protocol and the easyTcpSocket/tcpSocket classes. In the XOJO documentation, under ‘tcpSocket’, there is the following verbiage:

‘Because of the amount of error checking and handshakes, TCP is an extremely reliable protocol. When you send a packet of information, it is guaranteed to make it to the remote machine unless you have been disconnected, either abortive or orderly.’

So, regarding this, and using the ‘easyTcpSocket.sendMessage’ method, is it safe to assume the following (assuming the connection is not broken during communication):

  1. The data will always be successfully sent.
  2. The data will be free of corruption.
  3. The data will arrive in order (incase of the Xojo custom sendMessage, the message will arrive as a whole completed message just as it was sent).

The reason I’m asking is to determine if I need to include my own checks and validations on the data to ensure these factors.

One other question… regarding the easyTcpSocket documentation:

'The EasyTCPSocket class is designed only for easy communication among Xojo applications on the network. It is not designed to be the basis for custom TCP-based communication protocols. It works only for other applications that implement the EasyTCPSocket protocol. ’

I’m using this as indicated; however, the two applications are not locally. They are remote (about 100 miles apart) and as such encounter normal internet-type issues such as higher transmission/ping times, possible timeouts, etc. Is the ‘easyTcpSocket’ still an acceptable solution, or should I be looking into the ‘tcpSocket’ class? Again, I’m only still communicating between two Xojo-based applications and no other TCP sockets or devices. Thanks!

I am using the EasyTCPsocket class in my Apps connecting to various Linux hosts running netcat TCP listeners. Works great :slight_smile:

Good to know the stability is there. Any packets ever get dropped, or come in corrupted? Do you handle your own error/integrity handling? I’m still clueless if my assumptions are correct.

  1. packets will arrive in the order sent
  2. packets will not be corrupt

the TCP protocol insures this and packages will be resent if they are corrupted & the underlying stack will make sure they are reassembled in order

You CAN however get part of a “message” when the data available event is raised - but the data it contains will be correct & in order.
EasyTCP tries to make even that work simply so you can just set up EasyTCP sockets & go.
But if you need a custom protocol or a specific protocol then you probably need to work with TCP Sockets & implement the protocol yourself.

Thanks Norman, exactly what I was looking and hoping for. Appreciate the feedback… have a good one!