Really Confused With TCP Timeout

That how they had it in the tutorial. Also I tried different numbers and it still didn’t work.

tutorial???  doesn’t matter…

if you settimeout to zero you’re going to get timeouts, that’s basically inevitable, as you have ASKED it to immediately timeout.

but you also have some weird logic that checks “if (data) …”. else it assumes an error.  (which OF COURSE will be “timeout”)  but it might just be that there was no data left to begin with…  it looks like you’re “polling” tcp to build up the full message in tiny zero-second timeout chunks, and on the last of those chunks you should EXPECT it to return no data and timeout trying.  In fact, I’d expect that EVERY previous call to .receive() was returning a timeout error too - but you’re only reporting the last one (the one without any more data) because of your logic structure.

Not 100% sure but I think 0 in socket means to do whatever, but I gotta check. But like I said, even with a whatever second

timeout, it still returns timeout in the server.

Anyways, if I’m thinking what your thinking, I have the statement to see if there is anything there, because sometimes it is always false.

The rest of the stuff I have no idea what your talking about.