All pastes #449596 Raw Edit

hisham

public ruby v1 · immutable
·published 2007-04-20 09:18 UTC
rendered paste body
    begin      @tcps = TCPServer.new(@host, @port)      @ssls = OpenSSL::SSL::SSLServer.new(@tcps, @ctx)    rescue Errno::EADDRNOTAVAIL      sThread.start do        log = File.open("/tmp/olympus.log", "a+")        log.puts "cant bind! tring in 5 seconds..."        while @tcps == nil          sleep(5)          log.puts "trying again..."          begin            @tcps = TCPServer.new(@host, @port)            @ssls = OpenSSL::SSL::SSLServer.new(@tcps, @ctx)          rescue            # just loop again and keep trying to bind          end        end      end      log.close      sThread.join    end