Why does a multithreaded program gets hanged at recvfrom()?
I have written a client-server application using multithreading.
Initially I'm creating a thread to receive client requests in server. But only if the queue has registered clients, the code inside the thread will get executed. Hence for the FIRST client-request, I'm sending a buffer containing some pre-defined request to the server thru' client. But at server side, the program gets hanged at the first recvfrom() function call after the thread creation, in main() while at client side I'm able to perform recvfrom() and sendto() although there is problem at server side. The flow goes like this when I try to debug.... Client: sendto() OK Server: recvfrom() control gets stuck-up at this point Server: sendto() --- Client: recvfrom() OK Client: sendto() OK Server: recvfrom() --- Server: sendto() --- this is inside another thread Client: recvfrom() hang How can the client communicate well if server is getting blocked? Thanks, Regards, Kranti |
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.
http://www.linuxquestions.org/rules.php |
All times are GMT -5. The time now is 09:57 AM. |