Move to basic client/server structure.

This commit is contained in:
luxick
2018-03-03 14:36:41 +01:00
parent cb129eddd1
commit 8516650af4
25 changed files with 207 additions and 18 deletions

View File

@@ -0,0 +1,28 @@
import socket
try:
import cPickcle as pickle
except ImportError:
print('cPickle package not installed, falling back to pickle')
import pickle
from common import util, models
PORT = 12345
HOST = 'europa'
BUFFER_SIZE = 1024
s = socket.socket()
s.connect((HOST, PORT))
try:
data = 'get_dummy'
message = pickle.dumps(data)
util.send_msg(s, message)
response = util.recv_msg(s)
result = pickle.loads(response)
print(result, result.__dict__)
finally:
s.close()