-
Notifications
You must be signed in to change notification settings - Fork 0
/
baseClient.py
38 lines (26 loc) · 878 Bytes
/
baseClient.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import rpyc
CONN = None
def connect(host, port=5755):
global CONN
if CONN is not None: CONN.close()
CONN = rpyc.connect(host, port)
def sendTransaction(transaction):
global CONN
if (CONN is not None) and (not CONN.closed):
return CONN.root.sendTransaction(transaction)
def getTransaction(sig):
global CONN
if (CONN is not None) and (not CONN.closed):
return CONN.root.getTransaction(sig)
def getTransactionResponse(sig):
global CONN
if (CONN is not None) and (not CONN.closed):
return CONN.root.getTransactionResponse(sig)
def getLastTransaction():
global CONN
if (CONN is not None) and (not CONN.closed):
return CONN.root.getLastTransaction()
def getTransactionsAfter(sig):
global CONN
if (CONN is not None) and (not CONN.closed):
return CONN.root.getTransactionsAfter(sig)