       @._handle = handle
       @._listen2.apply(@, arguments)
 
+  ##
+  # whether or not we should intercept the call to listen
+  #
+  # requirements:
+  # * must be a worker in a cluster environment
+  # * must be attempting to listen on port 0
   _doNetClusterIntercept: ->
     # only intercept if we're a worker
     if !cluster.isWorker

  return e

##
# new server class extending node's net.Server
class Server extends net.Server
  _netClusterListen: (address, port, addressType) ->
    handle = new TCP()
    errno = 0

##
# net-cluster
# ===========
#
# Copyright (c) 2012 Ian Hansen (//github.com/supershabam)
# MIT License
#
# a drop-in replacement for node's net module that works in a sane way when clustered 
# -----------------------------------------------------------------------------------

net = require 'net'
cluster = require 'cluster'
dns = require 'dns'
nop = require 'nop'
TCP = process.binding('tcp_wrap').TCP

# utility function
extend = (obj, mixin) ->
  obj[name] = method for name, method of mixin    
  obj

# functions equivalent to those from node's net module
toNumber = (x) ->
  x = Number(x)
  if x >= 0
    return x
  return false

isPipeName = (s) ->
  typeof s is 'string' and toNumber(s) is false

