[rabbitmq-discuss] Stomp frame not terminated with null character

Jonatan Kallus jonatan at heysan.com
Thu Sep 18 20:46:56 BST 2008


Oh, I see, that should solve the problem! I'll quote you and post to the php
stomp list.

On Thu, Sep 18, 2008 at 12:37 PM, Tony Garnock-Jones <tonyg at lshift.net>wrote:

> 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
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20080918/51171cdf/attachment.htm 


More information about the rabbitmq-discuss mailing list