Home » Developing U++ » UppHub » Flatbuffers package
Re: Flatbuffers package [message #55799 is a reply to message #55798] |
Tue, 15 December 2020 13:15 |
Oblivion
Messages: 1092 Registered: August 2007
|
Senior Contributor |
|
|
Hello Xemuth,
Quote:. however, in my computer for whatever reason (my code seems correct comparing to socketClient/socketServer package) the data is received on server only when I close the client.
I'm on Linux now, but from the examples you've posted, my guess is that your calls are "blocking" (I don't see a Timeout value is set to 0 (non-blocking) or > 0 (time-constrained), which means it is blocking (Timeout == Null, by default).
int numberByteRead = s.Get(datas, 2048);
From docs:
int TcpScoket::Get(void *buffer, int len)
Reads at most len bytes into buffer, trying to do so at most for specified timeout. Returns the number of bytes actually read.
See, TcpSocket::Get() variant you use seems to expect 2048 bytes. And if the call is blocking, unless it receives >= 2048 bytes, it will block.
Upp ServerSocket/ClientSocket example, on the other hand, uses TcpSocket::GetLine(), which expects '\n', and as you can see in the examples, that is always provided.
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Tue, 15 December 2020 13:20] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Apr 24 13:03:33 CEST 2024
Total time taken to generate the page: 0.01213 seconds
|