summaryrefslogtreecommitdiff
path: root/code/spyglass/lib/spyglass/server.rb
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-08-28 07:20:13 -0600
committermo khan <mo@mokhan.ca>2013-08-28 07:20:13 -0600
commitdb1191ec0e7305d684383f8974e2fa437f77ad5a (patch)
tree5e27b197dff849d22d8e1f50eb75aa499b16bd06 /code/spyglass/lib/spyglass/server.rb
initial commitHEADmaster
Diffstat (limited to 'code/spyglass/lib/spyglass/server.rb')
-rw-r--r--code/spyglass/lib/spyglass/server.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/code/spyglass/lib/spyglass/server.rb b/code/spyglass/lib/spyglass/server.rb
new file mode 100644
index 0000000..cb97ff1
--- /dev/null
+++ b/code/spyglass/lib/spyglass/server.rb
@@ -0,0 +1,17 @@
+module Spyglass
+
+ class Server
+ include Singleton
+ include Logging
+
+ def start
+ # Opens the main listening socket for the server. Now the server is responsive to
+ # incoming connections.
+ sock = TCPServer.open(Config.host, Config.port)
+ out "Listening on port #{Config.host}:#{Config.port}"
+
+ Lookout.instance.start(sock)
+ end
+ end
+end
+