Navigation Menu

Skip to content

Commit

Permalink
Close connection on server error
Browse files Browse the repository at this point in the history
Such as EADDRINUSE.
  • Loading branch information
kou committed Apr 22, 2014
1 parent 6c7f5bf commit 7a3b622
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Expand Up @@ -17,6 +17,9 @@ function droonga(application, params) {

if (params.server) {
socketIoAdapter.register(application, params.server, params);
params.server.on('error', function(error) {
connection.close();
});
params.server.on('close', function() {
// The connection can be mocked/stubbed. We don't need to close
// such a fake connection.
Expand Down

0 comments on commit 7a3b622

Please sign in to comment.