Jump to content

php socket


dzedward

Recommended Posts

What would be a reason why a socket won't bind to my public IP, it will only bind to 127.0.0.1..  My actual IP is live and points to my domain.  I forwarded the port im listening on to my comp, and allowed it in my firewall.  I just don't get it.

Link to comment
Share on other sites

That is normally the case. Two ways of fixing it. The hard and impractical method would be to setup a local dns server. The easier, and probably best solution would be to add an entry to your /etc/hosts file.

 

66.74.14.110 localhost

 

If your using windows you'll need to search for a file called hosts and edit that. I'm not a windows user so I'm not sure where it exists, but I know it does. This is the file that everyone had to use to resolv host names to ip addresses before the wan got so big we needed dns.

Link to comment
Share on other sites

I added that to my hosts file, and am now able to ping it with no loss.  However, I'm still not able to bind or listen.  Here are the errors

 

unable to bind address [0]: The requested address is not valid in its context.

 

unable to listen on socket [0]: An invalid argument was supplied.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.