Question

When I start the server 'sails lift', it shown

debug: --------------------------------------------------------
debug: :: Mon May 05 2014 10:59:17 GMT+0700 (ICT)
debug: 
debug: Environment  : development
debug: Port     : 1337
debug: --------------------------------------------------------

info: handshake authorized AUcEOqQtYzXw0jBMiSbp
info: handshake authorized t9Y7k4zozlyXd1nwiSbq
info: transport end (socket end)
info: transport end (undefined)

I wonder what are those last two lines?

info: transport end (socket end)    
info: transport end (undefined)
Was it helpful?

Solution

TL;DR: If you don't want to see those messages, close any open pages / tabs that were connected to your Sails app before you re-lift it.

Those messages are coming from socket.io. It appears that you're lifting Sails with two open tabs / windows that were formerly connected via websockets to a running Sails instance, and reconnected once the server started again. However, something unexpected happened after the sockets reconnected, and they closed their connection. This can happen for any number of reasons; for example, an old socket connection may try to reconnect and resume a session which no longer exists, if you're using the memory store for sessions in Sails (which is the default for development mode). It's nothing to be concerned about; just make sure you refresh your pages after restarting Sails and all should be well. It's pretty rare that you'll need to maintain state for a web page between server reboots, but if you do, you can do it with a combination of the onConnect and onDisconnect methods in config/sockets.js and some front-end logic.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top