   #         # Otherwise, call same method recursively
   #         @readBuffer fd, position, size, buffer
   connect: ->
-    return if @connected
-    @connected = true
-    @emitEvent 'connect', @
+    @handleSocketEvent 'connect', null
 
   disconnect: ->
-    return unless @connected
-    @connected = false
-    @emitEvent 'disconnect', @
+    @handleSocketEvent 'disconnect', null
 
   isConnected: -> @connected
 

    return "DATA -> #{toStr(@to)}" unless @from
    "#{fromStr(@from)} -> #{toStr(@to)}"

exports.InternalSocket = InternalSocket

exports.createSocket = -> new InternalSocket

#     (c) 2011-2012 Henri Bergius, Nemein
#     NoFlo may be freely distributed under the MIT license
{EventEmitter} = require 'events'
IP = require './IP'

# ## Internal Sockets
#
