Permalink
Browse files

handle

  • Loading branch information...
1 parent 2cd969a commit d9e7e9b230f419e58b79566b64fab5a2281efe04 @lemanyk committed Dec 19, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 server.py
View
@@ -4,6 +4,8 @@
class Server(StreamServer):
"""
"""
+ BUF_SIZE = 1024 * 4
+
def __init__(self, port, host='0.0.0.0'):
self.port = port
self.host = host
@@ -14,7 +16,10 @@ def start(self):
self.server.serve_forever()
def handle(self, sock, addr):
- pass
+ buf = sock.read(self.BUF_SIZE)
+ file_name, buf = buf.split('\n', 1)
+ while True:
+ buf = sock.read(self.BUF_SIZE)
def stop(self):
print 'seeya!'

0 comments on commit d9e7e9b

Please sign in to comment.