diff options
Diffstat (limited to 'module/remote/ClientSocket.py')
-rw-r--r-- | module/remote/ClientSocket.py | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/module/remote/ClientSocket.py b/module/remote/ClientSocket.py index 74f66f0be..30eaf20e0 100644 --- a/module/remote/ClientSocket.py +++ b/module/remote/ClientSocket.py @@ -8,23 +8,31 @@ socket for connecting to the core's server """ import asynchat import socket -from RequestHandler import RequestHandler + +from ClientHandler import ClientHandler class ClientSocket(asynchat.async_chat): def __init__(self, client): - asynchat.async_chat.__init__(self) - self.client = client + asynchat.async_chat.__init__(self) + self.client = client self.data = "" - self.handler = RequestHandler(None) - self.set_terminator("\n") + self.handler = ClientHandler(None) + self.set_terminator("\n") self.create_socket(socket.AF_INET, socket.SOCK_STREAM) def handle_connect(self): - print "connected" - + print "connected" + + def handle_close(self): + print "Disconnected from", self.getpeername() + self.close() + def collect_incoming_data(self, data): + print "data arrived" self.data += data def found_terminator(self): - pass - #process + obj = self.handler.proceed(data) + self.push(obj) + print "pushed" + data = "" |