ID:               39683
 Updated by:       [EMAIL PROTECTED]
 Reported By:      peter dot wilton-jones at eads dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         *Network Functions
 Operating System: Windows 2003
 PHP Version:      5.2.0
 New Comment:

Please report issues in PECL modules using PECL bug tracker.
http://pecl.php.net/bugs/search.php?cmd=display&status=Open&package_name[]=ssh2
Thank you.


Previous Comments:
------------------------------------------------------------------------

[2006-11-29 14:42:37] peter dot wilton-jones at eads dot com

Description:
------------
I have a page that refreshes every minute. In that page, I open an ssh
session and obtain data. There is no way to close the ssh connection.
On reload, php opens a new connection but does not terminate the last
one or reuse the existing one.
Running a NETSTAT command reveals numerous connections in the
CLOSE_WAIT status after several minutes.
Can a close SSH option be included?

Reproduce code:
---------------
<?php
$connection = ssh2_connect('myserver',22);
ssh2_auth_password($connection,'username','password');
$stream = ss2_exec($connection,'df -k',FALSE);
stream_set_blocking($stream, TRUE);
$output = fread($stream,4096);
fclose($stream);
echo $output;
?>

Expected result:
----------------
Connection should show nothing

Actual result:
--------------
netstat -a shows

----------------
TCP     myweb:xxxx      myserver:22         CLOSE_WAIT
TCP     myweb:xxxx      myserver:22         CLOSE_WAIT
TCP     myweb:xxxx      myserver:22         CLOSE_WAIT
TCP     myweb:xxxx      myserver:22         CLOSE_WAIT
TCP     myweb:xxxx      myserver:22         CLOSE_WAIT
TCP     myweb:xxxx      myserver:22         CLOSE_WAIT
TCP     myweb:xxxx      myserver:22         CLOSE_WAIT
TCP     myweb:xxxx      myserver:22         CLOSE_WAIT
TCP     myweb:xxxx      myserver:22         CLOSE_WAIT
TCP     myweb:xxxx      myserver:22         CLOSE_WAIT
---------------


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39683&edit=1

Reply via email to