Now we can reconnect to a JSVM\!

This commit is contained in:
Jonatan Pålsson 2011-02-14 19:47:28 +01:00
commit 56c70c38b7
27 changed files with 381 additions and 40 deletions

23
python_client_reconnect Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env python
import sys, time, socket
HOST = 'localhost' # The remote host
PORT = int(sys.argv[1]) # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
# Call that function!
print "Calling myFun"
s.send(
"Token: %s\n\
Server-Command: call\n\
Content-Type: text\n\
Content-Length: 6\n\
\n\
myFun" % raw_input("Token >> "))
fs = s.makefile()
data = fs.readline()
print "Data: ", ' '.join(data.split(" ")[1:])
s.close()