module Byebug

def start_server(host = nil, port = PORT)


Starts a remote byebug
def start_server(host = nil, port = PORT)
  return if @thread
  Context.interface = nil
  start
  start_control(host, port == 0 ? 0 : port + 1)
  yield if block_given?
  mutex = Mutex.new
  proceed = ConditionVariable.new
  server = TCPServer.new(host, port)
  self.actual_port = server.addr[1]
  @thread = DebugThread.new do
    while (session = server.accept)
      Context.interface = RemoteInterface.new(session)
      mutex.synchronize { proceed.signal } if wait_connection
    end
  end
  mutex.synchronize { proceed.wait(mutex) } if wait_connection
end