ID: 47314 Comment by: bernd dot ott at k-m dot info Reported By: bernd dot ott at k-m dot info Status: Feedback Bug Type: SOAP related Operating System: Windows PHP Version: 5.2CVS-2009-02-05 (snap) Assigned To: dmitry New Comment:
open the socket with fsocketopen / fclose doesnt leave timewait connections. the problem is, this causes my .net soap server to a not response state. this is because all workers are allocated. i cant use keep alive, my page is using ajax to a php page which contains the soapclient. Previous Comments: ------------------------------------------------------------------------ [2009-02-18 15:41:39] dmi...@php.net According to http://tangentsoft.net/wskfaq/articles/debugging-tcp.html and http://www.developerweb.net/forum/showthread.php?t=2941 it's a normal TCP behaviour. (In case you run Apache benchmark you can see a lot of connections in TCP_WAIT state too) In case you call SOAP functions on the same SoapClient object and your Web Server responds with keep-alive HTTP header all the functions will use a single TCP connection. ------------------------------------------------------------------------ [2009-02-05 13:33:35] bernd dot ott at k-m dot info Description: ------------ Call to a Soapserver with the SoapClient leaves after a function call tcp-connection in state "time_wait". depending on your server your server get unreachable, because all workers are allocated by the waiting connections. the sample code leaves 100 open connections. if you call more than on function you get more open connections. the soapclient doesnt reuse the open connection. (this is not shown in the sample) the connections you can see in netstat or tcpview (sysinternals) Reproduce code: --------------- Client: <?php $i=100; while ($i>0) { $sc = new SoapClient(null, array('location' => "http://localhost/server.php", 'uri' => "http://test-uri/")); echo $sc->__soapcall("test", array('test'))."\r\n"; flush(); $i -= 1; } Server: <?php function test($x) { return $x."hallo"; } $server = new SoapServer(null, array('uri' => "http://test-uri/")); $server->addFunction("test"); $server->handle(); Expected result: ---------------- Client opens connection, does the function call and terminates connection. after correct close the should no connections in state "time_wait". Actual result: -------------- 100 connections are in time_wait status. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47314&edit=1