blob: 0214a1338daf0c9876e14d6fe48c96ce39cd3c91 [file] [log] [blame]
DR695Hb9116032019-05-21 11:13:45 -04001import socket
2
3
4class SocketUtils:
5 """SocketUtils is common resource for simple socket keywords."""
6
7 def __init__(self):
8 pass
9
10 def send_binary_data(self, host, port, data):
11 """ send raw bytes over tcp socket"""
12 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
13 # Connect to server and send data
14 sock.connect((host, int(port)))
15 sock.sendall(bytes(data))