You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current code assumes that we'll be able to receive and send messages with 1 system call. Since that isn't always the case, we need to handle scenarios where we receive or send incomplete messages.
When it comes to sending, I'm fine with just looping until we send the whole message. For receiving, however, I think we should modify our current message handler, so that it checks whether we received the full message. There are different approaches for this, such as sending end-of-message marker with every message.
Find reproducible cases where messages need more than 1 system call. This will allow testing the implementation.
For sending, loop the Write call until we send full message. This is the simplest approach, though it may block our thread for some time. However, I doubt it will be a problem.
Decide how to detect full message when receiving - end-of-message marker, JSON.
Implement receiving, but remember not to wait forever until the full message.
The text was updated successfully, but these errors were encountered:
Current code assumes that we'll be able to receive and send messages with 1 system call. Since that isn't always the case, we need to handle scenarios where we receive or send incomplete messages.
When it comes to sending, I'm fine with just looping until we send the whole message. For receiving, however, I think we should modify our current message handler, so that it checks whether we received the full message. There are different approaches for this, such as sending end-of-message marker with every message.
See the discussion - #149 (comment)
The text was updated successfully, but these errors were encountered: