Skip to content

Commit

Permalink
created artemis client
Browse files Browse the repository at this point in the history
  • Loading branch information
john.wohl@uconn.edu committed Dec 5, 2019
1 parent 96cdbb4 commit 331c381
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import socket
import sys
import time

class ArtemisClient:
def __init__(self, server_host, server_port):
self.server_host = server_host
self.server_port = server_port

def start(self):
# Create socket and connect to server
try:
server_sock = socket.socket(
socket.AF_INET, socket.SOCK_STREAM)
server_sock.connect((self.server_host, self.server_port))
except OSError:
if server_sock:
server_sock.close()
sys.exit(1)

#server_sock.sendall("!".encode("utf-8"))
print(server_sock.recv(1024).decode("UTF-8"))
print(server_sock.recv(1024).decode("UTF-8"))
server_sock.send("13\r\n".encode())
print(server_sock.recv(1024).decode("UTF-8"))

server_sock.close()

print("\nDone!")



client = ArtemisClient("artemis.engr.uconn.edu", 4705)
client.start()

0 comments on commit 331c381

Please sign in to comment.