Created
November 6, 2015 15:01
-
-
Save ahoka/16adf891cd9ef19777b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from socket import * | |
import umsgpack | |
s = socket(AF_TIPC, SOCK_RDM) | |
message = umsgpack.packb({ "version": 1, "command": "open"}) | |
length = s.sendto(message, (TIPC_ADDR_NAME, 40000, 0, 0)) | |
print("sent:", length) | |
--- | |
#!/usr/bin/env python | |
from socket import * | |
import umsgpack | |
print("Opening socket") | |
s = socket(AF_TIPC, SOCK_RDM) | |
print("Binding...") | |
s.bind((TIPC_ADDR_NAME, 40000, 0, 0)) | |
while True: | |
data, address = s.recvfrom(1024) | |
print("Received:", umsgpack.unpackb(data), "from:", address) | |
s.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment