 
         @rawSocket.on 'error', (args...) => @emit 'error', args...
 
-        @rawSocket.on 'close', => @open = false; @emit 'close'
-
-    close: () ->
-        super()
-        @rawSocket.end()
+        @rawSocket.on 'close', => @open = false; @emit 'close', false
+    
+    close: (noreply_wait=true, callback=null, args...) ->
+        unless not callback? or typeof callback is 'function'
+            throw new err.RqlDriverError "Second argument to close must be a callback function."
+
+        cb = (args...) =>
+            @rawSocket.end()
+            if callback?
+                callback(args...)
+
+        super(noreply_wait, cb, args...)
 
     cancel: () ->
         @rawSocket.destroy()

            # Unexpected token
            @emit 'error', new err.RqlDriverError "Unexpected token #{token}."

    close: ar () ->
        @open = false

    cancel: ar () ->
        @outstandingCallbacks = {}

        super(host, callback)

        if @rawSocket?
            @close(false)

        @rawSocket = net.connect @port, @host
        @rawSocket.setNoDelay()
