Hook up timers with us_loop_integrate

This commit is contained in:
Alex Hultman 2018-12-26 19:19:26 +01:00
parent ffb664509c
commit ba90a20e0f
3 changed files with 9 additions and 7 deletions

View file

@ -1,7 +1,9 @@
/* The stand-alone runtime has uWS namespace already loaded. */
var uWS = uWS ? uWS : require('../dist/uws.js');
const port = 3000;
const port = 9001;
// nice milestone to pass autobahn on both ssl and non-ssl with an without compression
const app = uWS./*SSL*/App({
key_file_name: '/home/alexhultman/key.pem',
@ -13,8 +15,8 @@ const app = uWS./*SSL*/App({
open: (ws, req) => {
console.log(ws);
},
message: (ws, message) => {
ws.send(message);
message: (ws, message, opCode) => {
ws.send(message, opCode); // need op to pass autobahn (guess binary on off is enough?)
}
}).listen(port, (token) => {
if (token) {
@ -23,6 +25,3 @@ const app = uWS./*SSL*/App({
console.log('Failed to listen to port ' + port);
}
});
/* This is not true for stand-alone */
console.log('Timers will not work until us_loop_integrate is done');