You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What are you trying to achieve or the steps to reproduce ?
This server uses the default implementation of route.options.timeout.socket which states node sockets will timeout after 2 minutes. However, the route handler has a 3 minute timeout, but the socket never hangs up after 2 minutes as expected.
'use strict';constHapi=require('@hapi/hapi');constinit=async()=>{constserver=Hapi.server({port: 4545,host: 'localhost'});/** * expecting default behavior that node socket hangs up after 2 minutes * however this timer exceeds 2 minutes then response is returned to user */server.route({method: 'GET',path: '/default-socket-timeout',handler: async(request,h)=>{consttimeout=delay=>newPromise(resolve=>setTimeout(resolve,delay));awaittimeout(180*1000);return'timer is done';}});awaitserver.start();console.log('Server running on %s',server.info.uri);};process.on('unhandledRejection',(err)=>{console.log(err);process.exit(1);});init();
The text was updated successfully, but these errors were encountered:
Context
What are you trying to achieve or the steps to reproduce ?
This server uses the default implementation of
route.options.timeout.socket
which states node sockets will timeout after 2 minutes. However, the route handler has a 3 minute timeout, but the socket never hangs up after 2 minutes as expected.The text was updated successfully, but these errors were encountered: