From 69f765b2476b77967588c0751be8afda7dc3adaf Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 31 May 2009 15:09:58 +0200 Subject: new socket encryption --- module/remote/ClientSocket.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'module/remote/ClientSocket.py') 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 = "" -- cgit v1.2.3