Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Created August 17, 2010 23:44
Show Gist options
  • Save kwilczynski/532665 to your computer and use it in GitHub Desktop.
Save kwilczynski/532665 to your computer and use it in GitHub Desktop.
class Server
def initialize
@server = nil
end
def start
@server = TCPServer.new(0)
end
def stop
(@server.shutdown; @server.close) if @server
end
def closed?
@server.closed? if @server
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment