
Sharing socket between goroutines
2 - Request / response with channels
In Part 2 of the series, i’m going to use channels to manage a request / response on a raw, shared TCP socket. If we assume that the interaction between the service and the client is always a simple request / response on the socket (see Part 1 for the use case), then: The client send a request (command or polling for data). Then it wait for the response in the socket, reading from socket buffer until the message frame is completed....