|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-04-22 20:18 UTC] alex dot taeffner at vr-web dot de
Description:
------------
Every Function which reads the answar of a TCP-Server Completely (since the last read (Pointer-Position to EOF)) hangs very long while executing the script.
fputs($TS_link, "help\n");
Well...
If I write
print fread($TS_link, 1024);
The Script returns the LAST line: OK
If I write
fpassthru($TS_link);
The Script loads more than a minute and returns ALL LINES since the last read.
It doesnt matter if there are yust two lines or een one line or if there are 100 lines to read.
Even if I write
while (!feof($TS_link)) {
print fgets($TS_link);
}
or
while (!feof($TS_link)) {
print fread($TS_link);
}
It is the same Problem.
It occurs whith every possibility.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 18:00:01 2025 UTC |
I've just found out another thing: If I close the TCP-Connection (Telnet) before I use the command it works fine. I mean it like that: fputs($TS_link, "dbuserid 2\n"); fputs($TS_link, "quit\n"); while(!feof($TS_link)) { $out .= fgets($TS_link, 1024); } print $out; Works fine! BUT fputs($TS_link, "dbuserid 2\n"); while(!feof($TS_link)) { $out .= fgets($TS_link, 1024); } print $out; lasts very verry long! My big problem: I cannot quit before I have read it because I want to read a value of the answer and use it in the next query. Is there another way?