Re: Sockets & 'requested address is not valid in its context'
| From: | Miguel Cruz | Date: | Mon, 08 Jul 2002 01:34:58 +0000 |
| Subject: | Re: Sockets & 'requested address is not valid in its context' | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-105996@lists.php.net to get a copy of this message | ||
On Sat, 6 Jul 2002, Zac Hillier wrote:
> I'm opening a port on a remote machine presently I'm using fsockopen() which
> is fine for opening the port and sending data however I'm having trouble
> reading data back from the port.
>
> So I've considered using socket functions but do not appear to be able to
> get a connection. When I run the code below pointing to 127.0.0.1 everything
> runs fine however when I point to 192.168.123.193 (Another machine on the
> local network without a server running) I get these errors.
You can't bind to a socket on another machine. You have to bind the socket
to a local address (i.e., on your machine) and then either listen for
incoming connections or initiate an outbound connection from that socket.
miguel