Blender-Pipeline/network/read_messages.py
Jeison Yehuda Amihud (Blender Dumbass) 3b58c5151b Testing scripts for Rendering
In order to develop rendering you might need to read all messages it's
giving. And / Or send to it messages manually. So these are 2 very simple
terminal based scripts that will do it for you. Please read the code to
before using.
2020-12-24 06:51:30 +00:00

36 lines
712 B
Python

# GNU General Public License
# This script is for developers of VCStudio rendering. This will read any
# message on 127.0.0.1 port 54545
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 54545
prev = ""
while True:
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind((UDP_IP, UDP_PORT))
sock.settimeout(0.05)
data, addr = sock.recvfrom(1024)
data = data.decode('utf8')
if prev != str(data):
print("<<< "+str(data))
prev = str(data)
sock.close()
except:
pass