Closed hamdijmii1992 closed 7 years ago
<<>>
is not an issue but a part of N2O protocol
https://github.com/synrc/n2o/blob/master/src/endpoints/n2o_proto.erl#L40
You can just ignore <<>>
.
Here is an example of CUSTOM TEXT protocol without <<>>
messages.
https://github.com/spawnproc/tic/blob/master/src/protocol.erl
I created an N2o protocol that routes messages over different family of application, (before that I used a cowboy websocket handler to do this job)
So for example I have this code in my protocol to send a message to a registered process
In my HTML client , firstly I register under the protocol with
And I verified that my html process was well registered
Then , From My same HTML client, I called the transmit protocol method like:
Basically in this stage I should receive a message contain "Hello I am Js" in my HTML client, but Always I received an empty data string like:
MessageEvent {isTrusted: true, data: "", origin: "ws://192.168.1.20:8000", lastEventId: "", source: null…}
INFO:I well received the reply message as follows:
when registering process:
MessageEvent {isTrusted: true, data: "process registered successfully", origin: "ws://192.168.1.20:8000", lastEventId: "", source: null…}
when submitting message:
MessageEvent {isTrusted: true, data: "message transmitted successfully", origin: "ws://192.168.1.20:8000", lastEventId: "", source: null…}
Also When I used my cowboy ws handler I didn't experience such issue.