How to use the close function from http

Find comprehensive JavaScript http.close code examples handpicked from public code repositorys.

46
47
48
49
50
51
52
53
54
55
if (!_.isUndefined(p)) port = p

server.on('error', err => {
  if (err.code === 'EADDRINUSE') {
    winston.error('Address in use, exiting...')
    server.close()
  } else {
    winston.error(err.message)
    throw err
  }
fork icon0
star icon0
watch icon1

202
203
204
205
206
207
208
209
210
211
  - `nsp` _(String)_
  - **Returns** `Namespace`

Initializes and retrieves the given `Namespace` by its pathname identifier `nsp`. If the namespace was already initialized it returns it immediately.

#### server.close([callback])

  - `callback` _(Function)_

Closes the socket.io server. The `callback` argument is optional and will be called when all connections are closed.
fork icon0
star icon0
watch icon2