         @close()
         @GlobalContext.notifySocketError()
         return false
-      if @serverAddress == "*"
-        @server?.listen @serverPort
-      else
-        @server?.listen @serverPort, @serverAddress
+      serverOptions = {}
+      serverOptions.port = @serverPort
+      if @serverAddress != "*"
+        serverOptions.host = @serverAddress
+
+      @server?.listen serverOptions, () =>
+          @GlobalContext?.notifyConsoleMessage "Listening on Address:Port " + @serverAddress + ":" + @serverPort
+          console.log "Listening on Address:Port " + @serverAddress + ":" + @serverPort
       return true
     catch e
       @GlobalContext?.notifyConsoleMessage "Error: " + "Socket Error:", e

    @serverAddress = params.serverAddress

  setPort: (port) ->
    @serverPort = port
    if @listening
      @close()
      @listen()


  setAddress: (address) ->
    @serverAddress = address
    if @listening
      @close()
      @listen()

  setAddressPort: (address,port) ->
    @serverPort = port
    @serverAddress = address
    if @listening
      @close()
      @listen()

  listening: ->
    return @server != undefined

    net = require "net"
    buffer = ''
    try
      console.log "Attempting to setup server"
      if @listening()
        @close()
      @server = net.createServer( (socket) =>
        socket.setEncoding('ascii');
        if !@GlobalContext.getCurrentDebugContext()
          @GlobalContext?.notifyConsoleMessage "Session initiated"
