       if server.inUseRetryCount < maxRetries
 
         # notify them
-        console.error 'Address in use, retrying in 3 seconds...'
+        console.error "Address in use, retrying in #{retryDelay / 1000} seconds..."
 
         # remember we tried
         server.inUseRetryCount++

        # retry in a bit
        setTimeout (->
          # call listen() in the callback
          server.close -> listen()
        ), retryDelay

      # else, we've gone too far. give up.


module.exports = (options) ->

  {server, relisten} = options

  # if they didn't specify a relisten function, then, we'll change listen()
  # to remember its args so we can reuse them.
  unless relisten?
    # remember the args in this var
    listenArgs = null

    # remember the original function (let's just put it right on it...)
    server.originalListen = server.listen

    # replace `listen()` with our function
    server.listen = (args...) ->
      listenArgs = args

      # let's avoid adding the listening callback multiple times
      # so, if the last arg is a callback...
      if typeof listenArgs[listenArgs.length - 1] is 'function'

        # make a copy of the args array so we can change it...
        listenArgs = listenArgs.slice()

        # remove the callback to avoid adding it again
        listenArgs.pop()

      # now make the real listen() call with their args
      server.originalListen args...

    # create our `relisten()` which calls the real listen() with the args we
    # remembered from them calling listen()
    relisten = -> server.originalListen listenArgs...

  retryDelay = options.retryDelay ? 3000
  maxRetries = options.maxRetries ? 3
