Created
January 28, 2011 04:53
-
-
Save mebens/799850 to your computer and use it in GitHub Desktop.
A very simple Ruby server setup.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'gserver' | |
class MyServer < GServer | |
def initialize(port=12345, *args) | |
super(port, *args) | |
end | |
def serve(io) | |
io.puts("The time is currently #{Time.now}") | |
end | |
end | |
server = MyServer.new | |
server.audit = true # logging on | |
server.start | |
while GServer.in_service?(12345) | |
# hit Ctrl+C to stop | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment