Re: Socket connection issue



On Sun, 5 Apr 2009 03:11:46 +0200, "mijn naam"
<whatever@xxxxxxxxxxxxxxx> wrote:

"Martin" <ironwoodcanyon@xxxxxxxxx> schreef in bericht
news:2cpft49328lotm6es6naudcq91jaoslbch@xxxxxxxxxx
On Sat, 4 Apr 2009 17:38:54 +0200, "mijn naam"
<whatever@xxxxxxxxxxxxxxx> wrote:

"Martin" <ironwoodcanyon@xxxxxxxxx> schreef in bericht
news:ovret4tssppt9n84gi6fkh08ukhfdhpbob@xxxxxxxxxx

On BOTH computers, netstat shows MyProcess.exe is listening on
0.0.0.0:1001

FWIW, both computers show that a process named alg.exe is listening on
127.0.0.1:1028

Any thoughts?

Not really, just this one: I doubt that your problem is related to php.
Try
to find another program to make a connection (e.g. telnet) and try
connecting to 127.0.0.1 port 1001. If you cannot, php is not part of the
problem.

I tried what you suggested - it all works just fine.

I ran MyProcess.exe, popped open a DOS window and ran telnet. Told it
to connect to "localhost 1001" and it did (I'm displaying the
connection status in MyProcess also). I then typed in one of the
commands that a PHP script sends and MyProcess responded correctly.
When I closed the telnet connection, the display in MyProcess went
back to "Listening". IOW, there is no doubt that this worked.

I then repeated the test using "127.0.0.1 1001" and again everything
worked properly.

I did all of the above on both computers - the one where the PHP
scripts execute ok and the one where they do not. The results were the
same in both cases.

Now, I'm not saying that this is a PHP problem. I'm just saying that I
don't know what the hell the problems is!

Any additional suggestions will be greatly appreciated. Thanks.


I'm almost out of ideas.

I'd continue hunting down this bug by trying various settings for $address:

// doesn't work: $address=$_SERVER['SERVER_NAME']
$address="localhost"
$address="localhost."
$address="127.0.0.1"

If "localhost" works, double check the contents of $_SERVER['SERVER_NAME']
If it doesn't but if "localhost." and/or "127.0.0.1" work, there's something
wrong with resolving names.

I would also try to connect to another service, one you know is running on
the box (http perhaps?). Does that work using
$address=$_SERVER['SERVER_NAME'] ? If so, the difference may be your other
application after all.

It boils down to: try to isolate the problem.

By the way: get rid of that monkey tail in front of fsockopen during testing
this.

Thanks.

I've discovered that 127.0.0.1 works so I'm going to go with that.
.



Relevant Pages

  • Re: Socket connection issue
    ... both computers show that a process named alg.exe is listening on ... connection status in MyProcess also). ... commands that a PHP script sends and MyProcess responded correctly. ... I did all of the above on both computers - the one where the PHP ...
    (comp.lang.php)
  • Re: Socket connection issue
    ... both computers show that a process named alg.exe is listening on ... I doubt that your problem is related to php. ... connection status in MyProcess also). ... I did all of the above on both computers - the one where the PHP ...
    (comp.lang.php)
  • Re: Socket connection issue
    ... FWIW, both computers show that a process named alg.exe is listening on ... to find another program to make a connection and try connecting to 127.0.0.1 port 1001. ...
    (comp.lang.php)
  • Re: CAN see site on localhost/dir but not localhost:port
    ... connection from other machines).Seems to be listening fine. ... I guess this points to a problem with reading PHP scripts on this port. ... the port method. ...
    (microsoft.public.inetserver.iis)
  • Re: Have you heard about a MySQL connection leak?
    ... Jerry Stuckle wrote: ... PHP ... Anyway, the reason a TCP socket connection stays open, is because neither end has closed it. ...
    (comp.lang.php)