<div dir="ltr">Oh, I see, that should solve the problem! I&#39;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">&lt;<a href="mailto:tonyg@lshift.net">tonyg@lshift.net</a>&gt;</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>
 &nbsp;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 &lt;<a href="mailto:tonyg@lshift.net" target="_blank">tonyg@lshift.net</a> &lt;mailto:<a href="mailto:tonyg@lshift.net" target="_blank">tonyg@lshift.net</a>&gt;&gt; wrote:<br>

<br>
 &nbsp; &nbsp;Aha!<br>
<br>
<br>
 &nbsp; &nbsp;Jonatan Kallus wrote:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$read = fgets($this-&gt;_socket, $rb);<br>
<br>
<br>
 &nbsp; &nbsp;fgets() reads lines. Maybe try a plain old read? You&#39;ll need to<br>
 &nbsp; &nbsp;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&#39;ll just use my own implementation that only connects and sends, and fails on any unexpected answers. That&#39;s all I&#39;ll need.<br>

<br>
<br>
 &nbsp; &nbsp;Tony<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br></div>