    
   ##-----------------------------------------
 
-  reconnect : () ->
+  _reconnect : () ->
     throw new Error "Reconnect called when @tcp_stream != null" if @tcp_stream
-    if @reconnect_delay?
+    if @reconnect_delay? and @_try_reconnect
       await setTimeout defer(), @reconnect_delay
       @_warn "reconnecting..."
       @connect()

    @tcp_opts = {} unless @tcp_opts
    @tcp_opts.host = @host
    @tcp_opts.port = @port
    
    @_remote_str = [ @host,  @port].join ":"
    @_lock = new Lock()

  ##-----------------------------------------

  close : () ->
    @_try_reconnect = false
    if @tcp_stream
      @tcp_stream.end()
      @tcp_stream = null
