Implementation of the Higgs Boson protocol.
Node JS implementation of the Boson protocol.
The example below users the server example found in the Scala demo
- Start the Scala server
- Run the example below
var higgs = require"./higgs.js"var client = "localhost" 12001clientconnectfor var i = 0; i < 1000; i++clientinvoke'nodejs'1.2 1 nulla:1 v:123451 2 3true "test"console.loga
1.20000004768371581nulla: 1 v: 123451 2 3true'test'
- The "high" bits (left most 32 bits of the 64 bits) are discarded
- The "low" bits are then treated as an integer and returned. This means if a long value is received that cannot fit into 32 bits it won't give what you expect.
- If Longs must be sent to the Node JS client then send it as a string!
- I've considered doing something similar to mongo but it seems over kill if its not absolutely required. Open to suggestions on how to handle it.
No matter what you try, no matter how much you yell floats are the only supported types WHEN SENDING, the server can send doubles back and they will be handled as expected. So on the server, don't expect Node JS to send a double, it'll always send a float.
It is possible for Node JS to send Doubles but to do that you'd have to be able to differentiate between a float and a double. Not found a sensible way to do that.