LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-21-2002, 12:20 AM   #1
Valluvan
LQ Newbie
 
Registered: Nov 2002
Posts: 9

Rep: Reputation: 0
Question Connection timed out


Hi,

I have written a socket program which connects to scs.yahoo.com(y! messenger service), but I get the "Connection timed out" error for connect() system call everytime.

Is there any system call available to increase the time out period ?

TIA!

Regards,
Valluvan
 
Old 11-23-2002, 01:38 PM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
would be great to know what language u use
 
Old 11-24-2002, 03:07 PM   #3
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Hmm. Try strace. Very very useful for tracking strange happenings. Say "man strace" to find out more.

You perhaps have some sort of dumb firewall blocking your connection. Redhat out of the box installs one.
 
Old 12-05-2002, 10:36 PM   #4
Valluvan
LQ Newbie
 
Registered: Nov 2002
Posts: 9

Original Poster
Rep: Reputation: 0
Hi cyent,

When installing Redhat I have chosen "No firewall" setting only.
But I am behind the proxy.. From the same machine I am able to connect to yahoo messenger through Yahoo's messenger client.


But now I am facing the new problem,
gethost() system call returns the error :Resource temporarily unavailable

dig command also says "Connection timed out; no servers could be reached"

Previously these two were working, but I have reinstalled RH8.0 and now these two are not working.

I have updated my /etc/resolve.conf accordingly.

Still not able to solve this problem..

j-ray: I am using C only!

Thanks in advance!

Regards,
Valluvan.
 
Old 12-05-2002, 11:33 PM   #5
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Look in your /etc/resolv.conf and get the ip address of your nameserver.

Try ping it.

If you can't, then evil things are afoot.

If you can't ping elsewhere, then you network setup is stuffed.

If you can ping elsewhere, but the nameserver seems to be dead. Check the ip address or contact your isp.
 
Old 12-19-2002, 11:46 PM   #6
Valluvan
LQ Newbie
 
Registered: Nov 2002
Posts: 9

Original Poster
Rep: Reputation: 0
Hi cyent,

I'm able to ping the nameserver.

I am able to connect web through Xwindows also..

But still I am not able to use gethost()...


Any help?

Thanks and Regards,
Valluvan
 
Old 12-22-2002, 02:40 PM   #7
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Hmm. First a small pedantic correction. XWindows is merely a program that controls your graphics card and allows access to it in a controlled and distributed fashion. ie. It has nothing to do with the web.

Perhaps you accessed the web from a web browser that displayed the results using X windows.

OK, that small silly remark out the way... On to the next. You say you are not able to use "gethost()", hmm, neither can I, as far as I can see their isn't such a standard function. There is a "gethostbyname()"

Probably what we need now to debug this further is a clip of the output of "strace -v". Run your program like so....
strace -v -o tlog ./yourprog youropts
Then find the area in the file "tlog" where gethostbyname is invoked and post that.
 
  


Reply



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
aMSN connection timed out d0lle Debian 1 09-05-2005 03:16 PM
connection timed out. moby Linux - Networking 0 10-13-2004 07:45 AM
Connection timed out tuttu Linux - Networking 2 08-06-2004 07:05 PM
connection timed out;no servers could be reached nitin34847 Linux - Networking 0 05-23-2004 12:47 AM
ssh: Connection timed out. [from school] nixel Linux - Networking 2 05-19-2004 12:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:49 AM.

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
Open Source Consulting | Domain Registration