public Method

Handlers.collision_handler

There's no documentation for this item.

Source Code

# File breakpoint_client.rb, line 106
def collision_handler()
  msg = [
    "  *** Breakpoint service collision ***",
    "  Another Breakpoint service tried to use the",
    "  port already occupied by this one. It will",
    "  keep waiting until this Breakpoint service",
    "  is shut down.",
    "  ",
    "  If you are using the Breakpoint library for",
    "  debugging a Rails or other CGI application",
    "  this likely means that this Breakpoint",
    "  session belongs to an earlier, outdated",
    "  request and should be shut down via 'exit'."
  ].join("\n")

  if RUBY_PLATFORM["win"] then
    # This sucks. Sorry, I'm not doing this because
    # I like funky message boxes -- I need to do this
    # because on Windows I have no way of displaying
    # my notification via puts() when gets() is still
    # being performed on STDIN. I have not found a
    # better solution.
    begin
      require 'tk'
      root = TkRoot.new { withdraw }
      Tk.messageBox('message' => msg, 'type' => 'ok')
      root.destroy
    rescue Exception
      puts "", msg, ""
    end
  else
    puts "", msg, ""
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.