Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee3de2a

Browse files
committed
small fixes
1 parent 951213e commit ee3de2a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Demo/rpc/rpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def __init__(self, bcastaddr, prog, vers, port):
376376

377377
def connsocket(self):
378378
# Don't connect -- use sendto
379-
self.sock.allowbroadcast(1)
379+
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
380380

381381
def set_reply_handler(self, reply_handler):
382382
self.reply_handler = reply_handler

Demo/rpc/xdr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def pack_string(self, s):
6969
self.pack_uint(n)
7070
self.pack_fstring(n, s)
7171

72-
pack_opaque = pack_string
72+
pack_opaque = pack_fopaque
7373

7474
def pack_list(self, list, pack_item):
7575
for item in list:
@@ -86,7 +86,7 @@ def pack_farray(self, n, list, pack_item):
8686
def pack_array(self, list, pack_item):
8787
n = len(list)
8888
self.pack_uint(n)
89-
self.pack_farray(n, list)
89+
self.pack_farray(n, list, pack_item)
9090

9191

9292
class Unpacker:
@@ -176,7 +176,7 @@ def unpack_string(self):
176176
n = self.unpack_uint()
177177
return self.unpack_fstring(n)
178178

179-
unpack_opaque = unpack_string
179+
unpack_opaque = unpack_fopaque
180180

181181
def unpack_list(self, unpack_item):
182182
list = []

0 commit comments

Comments
 (0)