<div dir="ltr">Oh, I see, that should solve the problem! I'll quote you and post to the php stomp list.<br><br><div class="gmail_quote">On Thu, Sep 18, 2008 at 12:37 PM, Tony Garnock-Jones <span dir="ltr"><<a href="mailto:tonyg@lshift.net">tonyg@lshift.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Jonatan,<br>
<br>
What I meant is that fgets (at least according to its documentation) waits for a newline that will never arrive. Using fread instead will fix the problem, but will require you to buffer any unused bytes for use by the next invocation of readFrame.<br>
<br>
Regards,<br>
Tony<br>
<br>
<br>
<br>
Jonatan Kallus wrote:<div><div></div><div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
On Thu, Sep 18, 2008 at 11:53 AM, Tony Garnock-Jones <<a href="mailto:tonyg@lshift.net" target="_blank">tonyg@lshift.net</a> <mailto:<a href="mailto:tonyg@lshift.net" target="_blank">tonyg@lshift.net</a>>> wrote:<br>
<br>
Aha!<br>
<br>
<br>
Jonatan Kallus wrote:<br>
<br>
$read = fgets($this->_socket, $rb);<br>
<br>
<br>
fgets() reads lines. Maybe try a plain old read? You'll need to<br>
buffer things between calls to readFrame, I guess.<br>
<br>
<br>
The difference between fgets and fread in this case is how it decides how big chunks to read at a time. fgets does not drop the characters that makes it stop reading, afaik. Newlines and alike is returned as well. Also, the nulls from other MQs seem to work with fgets. Thanks for your answers though! I will try to make it work once again later. For now I'll just use my own implementation that only connects and sends, and fails on any unexpected answers. That's all I'll need.<br>
<br>
<br>
Tony<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br></div>