Hook up timers with us_loop_integrate
This commit is contained in:
parent
ffb664509c
commit
ba90a20e0f
@ -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');
|
||||
|
@ -312,6 +312,9 @@ void Main(Local<Object> exports) {
|
||||
emptyNextTickQueue(isolate);
|
||||
});
|
||||
|
||||
/* Hook up our timers */
|
||||
us_loop_integrate((us_loop *) uWS::Loop::defaultLoop());
|
||||
|
||||
/*reqTemplateLocal->PrototypeTemplate()->SetAccessor(String::NewFromUtf8(isolate, "url"), Request::url);
|
||||
reqTemplateLocal->PrototypeTemplate()->SetAccessor(String::NewFromUtf8(isolate, "method"), Request::method);*/
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit c0af883bf9517670d7b729b23baeb5346766ed45
|
||||
Subproject commit 46537f6f2d500bc611e5dc6bb78a7a5da3baea01
|
Loading…
Reference in New Issue
Block a user