Fedora Linux Support Community & Resources Center
  #1  
Old 8th September 2005, 03:31 PM
philipaby Offline
Registered User
 
Join Date: Sep 2005
Posts: 2
linux boots slow after changing /etc/hosts

Hi everyone,
I am a realy newbie into the Linux (actually Unix) environment. I was writing a simple socket program in C where there server program was running on the same machine as the client program. My ip was 192.168.1.103 and when my server socket tried to bind to the ip with the port it wasn't able to. Gave the error "cannot bind to the requested ip address". I then changed the ip in the program to 127.0.0.1 and everything worked fine.

So I went ahead and added a line in the hosts file (which only had the 127.0.0.1 localhost) which said 192.168.1.103 testname. After this the socket program worked fine when I used the 192 ip.

That being said, when i restarted the machine, linux took a lot of time to reboot. As soon as i removed this newly added line from the hosts file, it was booting at it's normal speed.

My computer comes in through a router, I don't know if DHCP has anything to do with this.

Thanks in advance for the help. Really appreciate the fact that I can ask folks who know this stuff about this.

Kind Regards
Aby
Reply With Quote
  #2  
Old 8th September 2005, 03:47 PM
mndar Offline
Registered User
 
Join Date: Feb 2005
Posts: 1,102
Quote:
Gave the error "cannot bind to the requested ip address"
I read this somewhere. After creating a socket, set the socket options as follows
setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,&yes,siz eof(int));
where sockfd is the socket and yes is an integer with value 1
This solved the problem for me.
__________________
GStreamer XOverlay and VideoOverlay http://mndar.phpnet.us/gstreamer
Reply With Quote
  #3  
Old 29th September 2005, 08:44 PM
philipaby Offline
Registered User
 
Join Date: Sep 2005
Posts: 2
Thanks mndar,
That solved the problem. Really appreciate the help. Sorry for being late in the reply as I was out on vacation.
Reply With Quote
Reply

Tags
boots, changing, linux, or etc or hosts, slow

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora SOMETIMES boots very slow.. infernosoft Using Fedora 12 6th May 2009 10:24 PM
fedora boots so slow... Fittersman Using Fedora 4 10th October 2007 12:10 AM
installed wine, ms office, linux no longer boots jbob286 Using Fedora 6 25th January 2007 04:33 PM
Slow resolving hosts in anything HELP??? garymayor Servers & Networking 5 2nd February 2005 10:36 PM
Web browsers slow at resolving hosts in FC2 jdc EOL (End Of Life) Versions 5 20th May 2004 03:56 AM


Current GMT-time: 10:38 (Thursday, 18-12-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Girardot Picilagos Travel Photos on Instagram - SOCIAL ON FIRST - Datona Beach Flordia