RE: How to check port conection? socket_connect and fso ckopen have problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ok, I see the nature of the problem now.

You probably get all these SYNC_SENT and TIME_WAIT because
the hand shake is not properly done between the machines.

SYNC_SENT means that the local socket is trying to
established a connection.

TIME_WAIT indicates that no shutdown is (yet) recived
from the other end.

(This how is the classical SYNC-attack works, i.e.
open a port on the remote machine, and drop the
connection without picking up the SYNC_SENT pakages,
leaving the remote server port in TIME_WAIT - this way
one can "eat up" all ports on a remote machine.)

In these cases it very useful to have a look at the socket
state at the remote peer to determine weather the sync
package was received or not.


Firewalls can sometimes screw up this kind of traffic,
and drop SYNC packages in both direction without no good
reason - the firewall log may complain that the package
"looks like" it was forged, but in fact it is just fine.


-----Original Message-----
From: Sherry
To: php-windows@xxxxxxxxxxxxx
Sent: 10-5-2004 15:59
Subject: Re:  How to check port conection? socket_connect and
fsockopen have problems

I don't need 1000 times at once...
But I want to check ports periodically...
For example, every 2 minutes I must check 10 ports... So 1000 times * 2
/ 10
= 200 minutes = only 3 hours... :(
So, in one week, I'll have 7*24*60*10/2=50 000 connection in LISTENING
state!
To close these connection, I have to restart apache service... :(

Best regards,
Sherry.

"B.A.T. Svensson" <B.A.T.Svensson@xxxxxxx>
> Why do you need to call a socket 1000 times in order
> to find out if a service is available or not?

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux