Sorry, the error message was terse. in fact it expected either 1 ro 2 arguments for send. either "send socket" or "send socket data"
try this wd 'ws send ', (": sk) , ' hello' or wd 'ws send ', (": sk) , ' "hello client, username:"' or wd 'ws send ', (": sk) , ' *hello client, username:' I guess the send in the demo should already use the * Пт, 14 фев 2014, Pascal Jasmin писал(а): > Another issue I've uncovered in single application client and server > communication, also applies to separate applications. > > It appears that the server receives the connect (onOpen) event first (before > client), but even though the server is connected, it is not safe for it to > send yet. > > For instance, modifying the demo file: \addons\ide\qt\demo.ijs > > in the elseif jws_onOpen section of wssvr_handler , adding the line: > smoutput 'serv connected' > > wd 'ws send ', (": sk) , ' hello client, username:' > > > (loading the file will also load a client web page app) > > Hitting connect on the web app will display following message in console: > > serv connected > |ws : Need socket [data]: 73313136 hello client, username:: wd > | (wd ::(''"_)'qer') (13!:8)3 > > The previous problem I was reporting was that the client sending "too fast" > caused no error on send, but a disconnect. Here the server has been told its > connected, and has a socket number, but this weird error. Some suggestions: > > Perhaps the connect event could be delayed until the 2 sides are "really > connected" ? > send should return _1 in above case? > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm