Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

# Team Programming Assignment by: Alex O'Brien, Adam Momand, Royal Williams

# Date: 10/3/22
# Title: PA3Client.py
# Description: Client program will communicate with server

from socket import *


import time
serverName = '10.0.1.1'
serverPort = 12000
clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.connect((serverName, serverPort))
# client waits for other client
connectionStatus = clientSocket.recv(1024)
print(connectionStatus.decode())
sentence = input("Enter message to sent to server:")
clientSocket.send(sentence.encode())
# message from server
serverMessage = clientSocket.recv(1024)
print(serverMessage.decode())
time.sleep(10)
clientSocket.close()

You might also like