def socket
      close if @pid && @pid != Process.pid
      return @socket if @socket and not @socket.closed?
      @socket      = self.class.socket_factory.call(@options)
      @pid         = Process.pid
      @read_buffer = ''
      return @socket
    rescue => e
      raise Error, "Could not connect to #{host}:#{port}: #{e.class}: #{e.message}", e.backtrace
    end
def socket
      close if @pid && @pid != Process.pid
      return @socket if @socket and not @socket.closed?
      @socket      = self.class.socket_factory.call(@options)
      @pid         = Process.pid
      @read_buffer = ''
      return @socket
    rescue => e
      raise Error, "Could not connect to #{host}:#{port}: #{e.class}: #{e.message}", e.backtrace
    end
Internal: Return the socket that is connected to the Kestrel server

 Returns the socket. If the socket is not connected it will connect and
 then return it.

 Make sure that we close the socket if we are not the same process that
 opened that socket to begin with.

 Returns a KJess::Socket