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
Currently there is a single future which performs read + write for client + server (four distinct io operations). The code is overly complex and probably unreliable.
Suggestion is to refactor into one read future and one write future and instantiate one of each for client and server (with an enumeration to specify which one the instance is for since there is one small difference in functionality depending on the direction).
Because each future will run independently, it will be a simpler design with each future reading or writing for as long as the socket is ready and then pushing packets to the appropriate queue (client write queue or server write queue).
Taking the example of the server sending a large result set to the client, the "server read" future can be streaming packets into the "client write" queue, and the "client write" future can be streaming packets out of that queue and writing them to the client socket.
Hopefully channels can be used between futures for exchanging packets to remove the need to use mutexes.
The text was updated successfully, but these errors were encountered:
Currently there is a single future which performs read + write for client + server (four distinct io operations). The code is overly complex and probably unreliable.
Suggestion is to refactor into one read future and one write future and instantiate one of each for client and server (with an enumeration to specify which one the instance is for since there is one small difference in functionality depending on the direction).
Because each future will run independently, it will be a simpler design with each future reading or writing for as long as the socket is ready and then pushing packets to the appropriate queue (client write queue or server write queue).
Taking the example of the server sending a large result set to the client, the "server read" future can be streaming packets into the "client write" queue, and the "client write" future can be streaming packets out of that queue and writing them to the client socket.
Hopefully channels can be used between futures for exchanging packets to remove the need to use mutexes.
The text was updated successfully, but these errors were encountered: