diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-29 00:16:22 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-29 00:16:22 +0200 |
commit | 5f1c75fd93af98a5d870424971f0383ac4614058 (patch) | |
tree | d0e3d5d00295cdd5c9f65a755254aced21a6ff68 /module/remote/SocketServer.py | |
parent | premium and free download works with rapidshare (diff) | |
download | pyload-5f1c75fd93af98a5d870424971f0383ac4614058.tar.xz |
socket server basic
Diffstat (limited to 'module/remote/SocketServer.py')
-rw-r--r-- | module/remote/SocketServer.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/module/remote/SocketServer.py b/module/remote/SocketServer.py index 4469f89ac..3635e16d8 100644 --- a/module/remote/SocketServer.py +++ b/module/remote/SocketServer.py @@ -10,6 +10,7 @@ import asynchat import asyncore import socket import threading +from RequestHandler import RequestHandler class ServerThread(threading.Thread): @@ -41,18 +42,20 @@ class MainServerSocket(asyncore.dispatcher): class SecondaryServerSocket(asynchat.async_chat): - def __init__(self, pycore, *args): + def __init__(self, socket, pycore): print 'initing SSS' - self.pycore = pycore - asynchat.async_chat.__init__(self, *args) - self.set_terminator('\n') + asynchat.async_chat.__init__(self, socket) + self.pycore = pycore + self.handler = RequestHandler(pycore) + self.set_terminator('\n') self.data = [] def collect_incoming_data(self, data): self.data.append(data) def found_terminator(self): - self.push("daten") + self.handler.proceed(self.data) + self.push(str(self.pycore.plugins_avaible)) self.data = [] #having fun with the data def handle_close(self): print "Disconnected from", self.getpeername() - self.close()
\ No newline at end of file + self.close() |