Find the answer to your Linux question:
Results 1 to 6 of 6
hi, I am trying to write the socket programming in unix.first i checked the socket programming like AF_UNIX family and type is SOCK_STREAM in the socket() function which means a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    45

    Thumbs up socket no route to host


    hi,

    I am trying to write the socket programming in unix.first i checked the socket programming like AF_UNIX family and type is SOCK_STREAM in the socket() function which means a socket is created in the path.


    Then i tried to write by using AF_INET and type is SOCK_STREAM in the socket() which is connected to LAN, where i run the server prog in my computer and try to run the client prog in the other but i got an error in the connet() like "NO ROUTE TO HOST". I have used the port 5990 which are available for users.

    I checked both the program by runnig in my system giving a loopback address in the client IP address it is working fine.

    I dont know where i have gone wrong.
    PLz help me out


    Thanks,
    vinayak

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    On the system where you're doing the connect(), what happens when you ping the system to which you're trying to connect?
    --
    Bill

    Old age and treachery will overcome youth and skill.

  3. #3
    Just Joined!
    Join Date
    Feb 2008
    Posts
    45

    Thumbs up socket no route to host

    hi,

    When I ping from the client system for the server IP, it is working.
    I don't no whats wrong.

    can u plz guide me step by step.


    Thanks,

  4. #4
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Network programming isn't rocket science, but it does involve lots of details. I can't really guide you step by step through the whole thing, because my time is limited. Sorry about that.

    But do check out the excellent Addison Wesley book UNIX Network Programming, volume one, by W. Richard Stevens of happy memory.

    You'll learn the answers to many important questions you would never have thought to ask.

    Good luck!
    --
    Bill

    Old age and treachery will overcome youth and skill.

  5. #5
    Just Joined!
    Join Date
    Aug 2009
    Posts
    6

    ya, ping works.

    Ping works. but socket's connect( ) fails.
    I also face the same problem. Tell me the solution.

  6. #6
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Hello, najoshi

    Please start a new thread of your own if you are having problems with Linux. This thread is over 3 years old, so locking it down.

    Thank you.
    oz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •