LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 10-17-2005, 03:40 AM   #1
kranti
LQ Newbie
 
Registered: Oct 2005
Location: Pune
Posts: 17

Rep: Reputation: 0
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
 
Old 10-17-2005, 05:40 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
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
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does a multithreaded program gets hanged at recvfrom()? kranti Programming 1 10-17-2005 11:44 AM
Why does a multithreaded program gets hanged at recvfrom()? kranti Linux - General 1 10-17-2005 05:09 AM
Probelm regarding multithreaded program? geethu Programming 2 08-10-2005 01:39 AM
Debugging Multithreaded Program villie Programming 2 08-17-2004 12:24 PM
Signal handling in Multithreaded program souvik Programming 4 08-23-2002 08:28 AM


All times are GMT -5. The time now is 06:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration