Cleanup to test.py
This commit is contained in:
@@ -1,10 +1,23 @@
|
|||||||
import libzt
|
import libzt
|
||||||
import time
|
import time
|
||||||
|
|
||||||
print('joining virtual network...')
|
nwid = 0x1234567890ABCDEF
|
||||||
libzt.zts_startjoin('whatev_config', 0x1234567890ABCDEF)
|
|
||||||
print('fd = ' + str(libzt.zts_socket(1,2,3)))
|
|
||||||
|
|
||||||
print('looping forever, ping me')
|
# Authorization required via my.zerotier.com if this is a private network).
|
||||||
|
print('Joining virtual network...')
|
||||||
|
libzt.zts_startjoin('whatev_config', nwid)
|
||||||
|
|
||||||
|
fd = libzt.zts_socket(AF_INET,SOCK_STREAM,0)
|
||||||
|
if fd < 0:
|
||||||
|
print('error creating socket')
|
||||||
|
print('fd = ' + str(fd))
|
||||||
|
|
||||||
|
# Display info about this node
|
||||||
|
print('I am ' + str(hex(libzt.zts_get_node_id())))
|
||||||
|
address = None
|
||||||
|
libzt.zts_get_address(nwid, address, AF_INET)
|
||||||
|
print('assigned address = ' + str(address))
|
||||||
|
|
||||||
|
print('Looping forever, ping me or something')
|
||||||
while True:
|
while True:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
Reference in New Issue
Block a user