Re: fsockopen with unusual port
| From: | Danny Shepherd | Date: | Wed, 08 May 2002 11:32:06 +0000 |
| Subject: | Re: fsockopen with unusual port | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96568@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Analysis & Solutions" <danielc@analysisandsolutions.com>
To: "PHP List" <php-general@lists.php.net>
Sent: Wednesday, May 08, 2002 3:30 AM
Subject: Re: [PHP] fsockopen with unusual port
> On Tue, May 07, 2002 at 09:28:14PM -0500, Larry Rosenman wrote:
> > On Tue, 2002-05-07 at 21:25, Analysis & Solutions wrote:
> > >
> > > I'm trying to use fsockopen() with an unusual port number. It comes
> > > back as Error Number 61, "Connection refused." If I change the port
to
> > > something normal, like 80 or 23, it works fine. What's up?
> > >
> > sounds like nothing is listening on that port.
>
> Yep. The goal is to have this script listen for connections coming
> later. That's not doable with fsockopen()?
Nope, fsockopen simply acts as a client, openning connections to servers.
I think you want to take a look at
http://uk.php.net/manual/en/ref.sockets.php
which is a nearer what you seem to be after - the given example shows how to
build a simple HTTP server, you should be able to adapt it to your needs.
HTH
Danny.