colosseum-near-rt-ric/setup/xapp-sm-connector/external_socket_tester.py

14 lines
293 B
Python
Raw Permalink Normal View History

2021-12-08 21:17:46 +01:00
import socket
if __name__ == '__main__':
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('127.0.0.1', 7000))
msg = 'terminate'
bytes_num = client.send(msg.encode('utf-8'))
print('Socket sent ' + str(bytes_num) + ' bytes')
client.close()