Reply To: [Solved] Sending commands via TCP did not work

Home Forums V-Control General [Solved] Sending commands via TCP did not work Reply To: [Solved] Sending commands via TCP did not work

#642
Marcus_Klein
Participant

Hello again,

I wrote a Python script to send the string via TCP socket:

#!/usr/bin/python

import socket
import sys

# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = (‘192.168.0.1’, 10101)
sock.connect(server_address)

s = chr(4) + “0” + chr(5) + “scrRunTask” + chr(5) + “Shutdown_All_PCs” + chr(6)

try:
# Send data
print >>sys.stderr, ‘sending “%s”‘ % s
sock.sendall(s)

finally:
print >>sys.stderr, ‘closing socket’
sock.close()

This works for me 😉

Thanks again for your support and your patience, Dierk!

Scroll to top