1
Network / Blocking sockets and multithreading
« on: March 16, 2011, 04:40:04 am »
I think I understand what you are saying. (not entirely sure though.) But the thing is, from my understanding, that might result in a sort of networking/multithreading deadlock. Say both the server and client are waiting to receive messages. While receiving neither side can send, and since both sides are waiting for the other to send nothing ever happens.
Maybe I am wrong though, I guess mostly it depends on whether a socket can send one message while trying to receive another.
If not another idea I had was maybe using blocking sockets that terminate frequently to give sending a chance. This would simulate non-blocking pretty well, but first I need to find out how reliable non-blocking sockets are. A member of the team said that he never could make them work.
Maybe I misunderstand what you were trying to say though.
Maybe I am wrong though, I guess mostly it depends on whether a socket can send one message while trying to receive another.
If not another idea I had was maybe using blocking sockets that terminate frequently to give sending a chance. This would simulate non-blocking pretty well, but first I need to find out how reliable non-blocking sockets are. A member of the team said that he never could make them work.
Maybe I misunderstand what you were trying to say though.