def stop
    logger.debug "stopping server"
    @status = :stopping
    EM.stop_server @sig
    done if @connections.empty?
    sleep 0.1 while @status != :stopped unless EM.reactor_thread?
  end
def stop
    logger.debug "stopping server"
    @status = :stopping
    EM.stop_server @sig
    done if @connections.empty?
    sleep 0.1 while @status != :stopped unless EM.reactor_thread?
  end
if on reactor thread, start shutting down but return if connections still
 in process, and let them disconnect when complete -- server is not really
 done until it's status is stopped.
 if not on reactor thread, wait until everything's cleaned up and stopped