Thread: Bind problem

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    10

    Bind problem

    I have a simple server program that connects with client program. It worked with 127.0.0.1 (should be local ip, I got it from a tutorial), but when I changed to my real ip the server part stopped working. The client seems to work. The 'bind' function fails.

    It might be some elementary problem, as I'm new to network programming. The ports seem to be forwarded, as my router gives logs for the client application and seems to be not blocking it. Might be I don't know what should I set the server ip to, but I thought that my own ip should work.

    I don't know much about it. Is it logical that my router doesn't even give logs as I launch the server? Should it work with my own ip?

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    If by "your real IP" you mean your 192.168 home LAN ip, which distinguishes one computer hooked up to your router from another computer on the same router, it should work.

    If you mean the real IP issued to you by your service provider to reach the outside world, you are out of luck: there is no way they will let you use that to operate a server.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    10
    Thanks, that was really my problem, caused by a lack of knowledge in that field.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. beginner problem
    By The_Nymph in forum C Programming
    Replies: 4
    Last Post: 03-05-2002, 05:46 PM