Bug #15040 Updated: Socket
| From: | webmaster at weathermetrics dot com | Date: | Tue, 15 Jan 2002 16:20:35 +0000 |
| Subject: | Bug #15040 Updated: Socket | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-77140@lists.php.net to get a copy of this message | ||
ID: 15040
User updated by: webmaster@weathermetrics.com
Reported By: webmaster@weathermetrics.com
Old Status: Feedback
Status: Open
Bug Type: Sockets related
Operating System: Windows NT 4.0
PHP Version: 4.1.1
New Comment:
I'm sorry I should have made this clear. This was a pre-existing VB
App that I have been running for a year now doing the same procedure
from embedded clients. It is a possibility I am not fully
understanding the life of a PHP socket vs. other socket types. Does
anyone have any documentation on the life of a PHP socket. It seems to
me like the socket is dyeing before sending the message.
Thanks,
Eric Levy
Previous Comments:
------------------------------------------------------------------------
[2002-01-15 07:18:37] sander@php.net
Are you sure this is a problem with PHP and not with Visual Basic???
------------------------------------------------------------------------
[2002-01-15 03:43:37] webmaster@weathermetrics.com
I keep getting the following error:
"Microsoft Visual Basic Run-time error '10054': THe connection is reset
by remote side"
when I try to connect a PHP UDP socket to a VB Application. I am
trying to dump a small packet of data to the VB program using the
following PHP code:
$port=getPort($t);
$host=getHost($t);
$prot=getProtocol($t);
$fp = fsockopen ($prot.$host, $port, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
$w=fputs ($fp, URLUnEncode($Commands["DATA"]));
}
}
if (!$fp)
{
//$w=socket_set_blocking(TRUE);
//sleep(30);
$w = fclose ($fp);
}
The problem is the socket works fine the first time, but the second
time the script is run (~1 min between successive runs) the application
gives this error. It seems to me the script is closing before it is
done sending the data. I tried various socket timeouts, setting the
blocking to true and false, and putting a pause in. Nothing seemed to
work. Is it because only the script is sending data, I have not seen
any PHP examples, where the script is the only side sending data.
Thanks,
Eric Levy
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=15040&edit=1