summaryrefslogtreecommitdiffstats
path: root/sockettest.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-05-31 21:06:18 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-05-31 21:06:18 +0200
commit3755da2af7e3f79171d505dd81e0c0b63b4adb9f (patch)
treeb2267b76fe897c3c27ce6ed2a019de08c1394647 /sockettest.py
parentxupi.in works again (diff)
downloadpyload-3755da2af7e3f79171d505dd81e0c0b63b4adb9f.tar.xz
gui socket finally works
Diffstat (limited to 'sockettest.py')
-rw-r--r--sockettest.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/sockettest.py b/sockettest.py
index eab6608c2..5cfebe581 100644
--- a/sockettest.py
+++ b/sockettest.py
@@ -10,11 +10,12 @@ import base64
import hashlib
import random
import string
+import time
import cPickle
from Crypto.Cipher import Blowfish
from module.remote.RequestObject import RequestObject
-from module.remote.ClientSocket import ClientSocket
+from module.remote.ClientSocket import SocketThread
class Handler:
def __init__(self):
@@ -59,15 +60,20 @@ import socket
handler = Handler()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('localhost', 7272))
+th = SocketThread(sock)
+#th.socket.connect(('localhost', 7272))
print "Connected to server"
obj = RequestObject()
obj.command = "exec"
obj.function = "get_downloads"
-sock.sendall(handler.encrypt(obj) + "\n")
+data = handler.encrypt(obj)
+print "going to push", data
+th.socket.push(data + "\n")
+#response = sock.recv(8192)
-response = sock.recv(8192)
-
-print "Received:", handler.decrypt(response).response
-sock.close()
+#print "Received:", handler.decrypt(response).response
+#sock.close()
+while True:
+ sleep(10000)