Closed Contango1000 closed 9 years ago
try to adapt this example: http://www.homegenie.it/forum/index.php?topic=495.msg2756#msg2756 how would you suggest to improve the code of TcpClientHelper class? See the code here: https://github.com/genielabs/HomeGenie/blob/master/MigFiles/SupportLibraries/TcpClientLib/TcpClient.cs Any help is highly appreciated =)
Looking at the code for receiving messages, i cannot see any way this will work without closing the connection. The method Socket.EndReceive(...) will only return zero (0) if the connection is closed.
There are three ways, in general, to determine when a message has completed:
For binary data. option 2 is probably the best, while for string messages, marker is probably easier.
Anyway, option 1 is not a very good solution, since this will also close communication the other way.
Is there a plan for further development of this? I cannot find much information on usage of TcpClientHelper.
Regards
Paul