diff options
author | DR695H <dr695h@att.com> | 2019-05-21 11:13:45 -0400 |
---|---|---|
committer | DR695H <dr695h@att.com> | 2019-05-21 11:17:40 -0400 |
commit | b911603f288d237b433cad9d488c2fa2d6985df7 (patch) | |
tree | 72ae2df105fa80672dcc6ea5ff191dd5bc1a86c3 | |
parent | ff20b737dc3bc17dfc4d5ce83614a10c2240202f (diff) |
add socketutils
socketuitls will let us replace rammbock fro simple libs
Change-Id: I20c44a214bc2e839cb1c261d0ef2f0dd06bcfb54
Issue-ID: TEST-155
Signed-off-by: DR695H <dr695h@att.com>
-rw-r--r-- | robotframework-onap/eteutils/SocketUtils.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/robotframework-onap/eteutils/SocketUtils.py b/robotframework-onap/eteutils/SocketUtils.py new file mode 100644 index 0000000..0214a13 --- /dev/null +++ b/robotframework-onap/eteutils/SocketUtils.py @@ -0,0 +1,15 @@ +import socket + + +class SocketUtils: + """SocketUtils is common resource for simple socket keywords.""" + + def __init__(self): + pass + + def send_binary_data(self, host, port, data): + """ send raw bytes over tcp socket""" + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + # Connect to server and send data + sock.connect((host, int(port))) + sock.sendall(bytes(data)) |