Hi Takamasa,

Some comments below. :)

On Thu, Aug 12, 2010 at 9:17 AM, yaws@mitsuji.org <yaws@mitsuji.org> wrote:
Hello, I'm a big fan of yaws and Erlang!

I have a problem about websocket implementation.
yaws_api:websocket_unframe_data/1 fails sometime.

websocket_unframe_data(DataFrameBin) ->
       {ok, Msg, <<>>} = yaws_websockets:unframe_one(DataFrameBin),

I found return value of unframe_one/1 contains
binary data at 3rd element that is not empty.
This data may contains following frames.

I don't recall the rationale involved in coding yaws_api:websocket_unframe_data/1 like that but it might be that that was the expected return value in the protocol (back at that time).
At this point the reference I used is no longer accessible: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-66#page-26 :\

I think I need a function like this.

websocket_unframe_all(DataFrameBin) ->
       yaws_websockets:unframe_all(DataFrameBin, []).

But when use this, I need to loop through list of frames
each time I receive a socket.

Does anyone have more smart solution deal with this problem?

Since the first implementation there have been some updates to the protocol:
The behaviour you are encountering might be the result of a more recent websockets implementation by the browser's end.
Which browser are you using?

I won't be able to help you sort this out at this point but hopefully other mailing list lurkers can lend an hand and/or step in and update the current implementation. ;)

Best regards,
Davide :)

Mitsuji, Takamasa

This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
Erlyaws-list mailing list