It's my first post on the group, I'm not c++ programmer. For last 10 years I did everything except c/c++ (or very little). I find it really difficult, more difficult than I expected. Worst of all I know it really makes sense... But, the question:
We have two sockets. Server calls socket(), listen(), accept(), client calls socket(), connect(), than send(), server calls recv(), than send(), client... and so on...
In all examples I can find it's that client requests, than server responds...
My question is if I will keep the socket open and connected, can I push from the server to the client (without request)? Isn't request/response just a simplification and it doesn't really matter in case of socket? So I can just write to the buffer of connected socket and read it on the other side?
We have two sockets. Server calls socket(), listen(), accept(), client calls socket(), connect(), than send(), server calls recv(), than send(), client... and so on...
In all examples I can find it's that client requests, than server responds...
My question is if I will keep the socket open and connected, can I push from the server to the client (without request)? Isn't request/response just a simplification and it doesn't really matter in case of socket? So I can just write to the buffer of connected socket and read it on the other side?
Comment