From: Arif <ar...@ri...> - 2013-02-11 14:50:30
|
On 02/06/2013 12:31 PM, Christopher Faulet wrote: >> I have tried to write some client functions to test the yaws websocket >> server (https://github.com/arifishaq/erlws.git) >> >> I have discovered a couple of interesting things I didn't know about: >> - there is support for the ping message >> - there is support for fragmented messages >> >> On the latter, I have run into some problems and am curious to know >> what's >> wrong, if anything is. >> >> I am testing the server usign ct_run (see the suite in the test >> directory) >> >> In practice, everything works, except when I try to send fragmented >> messages. If there isn't a pause of at least 1 ms between the sending of >> each fragmented message, the tests fragmented_text_delivery and >> fragmented_binary_delivery fail. >> >> Could this be a problem with the common test framework? Or with yaws? >> Actually, the server does collect all the fragments and reports the >> composed message to the callback module. >> > Hi, > > With the yaws_websockets module from the master branch, there are some > bugs. One of them concerns fragmented messages. > We are working on a new version of this module, with various fixes and > improvements. We are actually reviewing the code, but you can test it by > checking out the websockets branch on github[1]. > > With this version, your testsuite successfully runs for me. > > About your question on the support of ping messages, it works. There are > 2 kinds of callback module: basic and advanced. For a basic callback > module, the ping messages are handled by Yaws and replies are > automatically sent without notification to the callback module (this is > your case with your testsuite). For an advanced callback module, ping > messages are passed to the callback module and this is its > responsibility to reply to the client. See the example of advanced > callback module[2] for details. > > If you try the websockets branch, your feedback is welcomed. Thanks for the feedback. I have tested the websocket branch and confirm that the tests pass. That's great! I will try out the advanced ping scenario as well and add it to the test suite Many thanks and best regards Arif > [1] https://github.com/klacke/yaws/tree/websockets > [2] > https://github.com/klacke/yaws/blob/websockets/examples/src/advanced_echo_callback.erl > |