I have a server which maintains some shares state.
The clients can send some requests and get an answer from the server.
Sometimes the server needs to give some information to the client asynchronously (without getting a request first)
To make it easier on myself I would create two TCP conntections. The first where the client would initiate a request and get an answer, and the second one where the server would initiate (and optionally get an answer).
I know in theory this could be done in a single connection, but you could run into the problem where the client requests some information and the server would respond first with some request to the client instead of the answer. So there has to be logic to classify what the server has send, instead of just assuming that it is the answer to the request.
Because I did not find this pattern in the wild yet, are there any downsides?