-net = require "net"
-cluster = require "cluster"
-dns = require "dns"
-nop = require "nop"
+##
+# 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 from node's net module
+# 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
 

          addressType = 4
        return cb(null, [ip, port, addressType, backlog])

  listen: ->
    # skip this override if possible
    if !@_doNetClusterIntercept.apply(@, arguments)

      return @emit 'error', err if err
      @_netClusterListen.apply(@, portArgs)

# provide everything that the net module does
extend(module.exports, net)

# but override the createServer function to use our server
module.exports.createServer = ->
  new Server(arguments[0], arguments[1])
