[rabbitmq-discuss] Stomp frame not terminated with null character
Tony Garnock-Jones
tonyg at lshift.net
Thu Sep 18 20:37:40 BST 2008
Hi Jonatan,
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.
Regards,
Tony
Jonatan Kallus wrote:
>
>
> On Thu, Sep 18, 2008 at 11:53 AM, Tony Garnock-Jones <tonyg at lshift.net
> <mailto:tonyg at lshift.net>> wrote:
>
> Aha!
>
>
> Jonatan Kallus wrote:
>
> $read = fgets($this->_socket, $rb);
>
>
> fgets() reads lines. Maybe try a plain old read? You'll need to
> buffer things between calls to readFrame, I guess.
>
>
> 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.
>
>
> Tony
>
>
More information about the rabbitmq-discuss
mailing list