davebryson / erlang_websocket Goto Github PK
View Code? Open in Web Editor NEWWebSocket Server and Client implementation in Erlang/Mochiweb
WebSocket Server and Client implementation in Erlang/Mochiweb
I have found a problem: websocket_client fails to properly parse messages if server sends them in rapid succession. I have a Jetty WebSocket Java server that generates Json messages.
I have JavaScript test client and websocket_client Erlang connected to the same server.
If server sends Json messages rapidly, websocket_client sometimes pushes these concatenated (separated by special characters) in onmessage(Data).
This causes Json parser to generate exception.
If I call websocket_client:start(Host, Port, ?MODULE), but server is not running, the API generates exception:
** exception exit: {badmatch,{error,econnrefused}}
in function websocket_client:init/1 (d:/DAVEBR~1/src/websocket_client.erl, line 46)
in call from gen_server:init_it/6 (gen_server.erl, line 297)
in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 227)
It would be nice to have some callback invoked when connection cannot be established.
Is there any way to catch this exception in my code?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.