urcontrol/tests/socketsendtest.py

16 lines
226 B
Python
Raw Normal View History

2022-05-31 13:05:06 +00:00
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 30002
BUFFER_SIZE = 1024
message = "12.3,20.15"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send(message.encode('utf-8'))
s.close()