Help me I'm stuck | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Help me I'm stuck

I did a basic server client model, everything works fine. But it just freezes when getting the input. Meaning it never gets the data that is sent from the other side. Server sometimes gets the client data but client never gets the server data. What could be wrong?

1st Dec 2021, 11:51 AM
Rishi
Rishi - avatar
2 Answers
+ 3
Without knowing java or seeing the code and assuming your code is actually correct. Did you disable Nagle's algorithm? Maybe with a TCP_NO_DELAY option somewhere. It's an optimization that causes data to only be send once the buffer is full so if you have it enabled and only send little bits it may never send the data at all. Try sending alot of data to test that. Otherwise I have no idea. https://en.wikipedia.org/wiki/Nagle%27s_algorithm
1st Dec 2021, 12:04 PM
Dennis
Dennis - avatar
+ 1
Dennis I think yes, I've added a line that flushes the buffer(or empties it by sending the buffered data) after each input line. So I think something else is wrong
1st Dec 2021, 2:56 PM
Rishi
Rishi - avatar