Skip to content

Instantly share code, notes, and snippets.

@ahoka ahoka/tipc.py
Created Nov 6, 2015

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.