MR RAJA has research collaboration with other scientists located in different cities around the world. Such collaboration involves online meetings among the scientists interested in a specific topic and participation in students/staff presentations. Building around socket programming and your knowledge of python programming, you are tasked to develop a client/server system that makes conversion of time between South Africa and different other cities in the world related to the research collaboration between MR RAJA and his colleagues. The goal is to develop a system that provide MR RAJA services which are similar to Google Calendar but with the possibility of adding many more functionalities in the future. The requirements are as follow • The server maintains a file of the time differences between South Africa and at least 30 other cities in the World.: e.g. Missouri, Tokyo, Kinshasa, Lubumbashi, Kigali, Yaoundé, Melbourne, Stockholm, Brussels, Paris, Laval, Montreal, Toronto, Quebec, Vancouver, etc. • The client maintains a file of meetings scheduled in different cities which includes the dates of the meetings, the cities’ names, the topic of the meetings, and the platform to be used. The client process will read the file of meetings and submit time conversion requests to the server. The platform may be Zoom, Meet, and Teams. Each request is read from the file of the meetings and has the format: o Date, City, Time, Topic, Platform Where the Date is the date in the organizing City and the time is also the time in the organizing city. • The server’s response will have a similar format to the request but the South African Date and Time. Note that due to time differences, the Date in a city around the world may differ from the Date in South Africa. Each request is read from the file of the meetings and has the format: o Date, City, Time, Topic, Platform Where the Date is the date in South Africa and the City is the city in South Africa. # tcp-server.py from socket import * # create the socket # AF_INET == ipv4 # AF_INET6 == ipv6 # SOCK_STREAM == TCP serverPort = 12000 serverSocket = socket(AF_INET,SOCK_STREAM) #bind a socket to some port on the server serverSocket.bind(("",serverPort)) serverSocket.listen(5) print ("The server is ready to receive") while True: connectionSocket, addr = serverSocket.accept() sentence = connectionSocket.recv(1024).decode() capitalizedSentence = sentence.upper() connectionSocket.send(capitalizedSentence.encode()) connectionSocket.close() # tcp-client.py from socket import * serverName = "127.1.1.0" serverPort = 12000 clientSocket = socket(AF_INET, SOCK_STREAM) clientSocket.connect((serverName,serverPort)) sentence = input("Input lowercase sentence:") print (sentence) #text = raw_input("Enter a Letter: ").lower() print text clientSocket.send(sentence.encode()) modifiedSentence = clientSocket.recv(1024) print ("From Server:", modifiedSentence.decode()) clientSocket.close() 30 countries to use. Belo Horizonte Gaborone Francistown Molepolole Shanghai Guangzhou Beijing Havana Santiago de Cuba Holguín Copenhagen Aarhus Odense Cairo Giza Alexandria Helsinki Espoo Tampere Paris
MR RAJA has research collaboration with other scientists located in different cities around the world. Such collaboration involves online meetings among the scientists interested in a specific topic and participation in students/staff presentations. Building around socket programming and your knowledge of python programming, you are tasked to develop a client/server system that makes conversion of time between South Africa and different other cities in the world related to the research collaboration between MR RAJA and his colleagues. The goal is to develop a system that provide MR RAJA services which are similar to Google Calendar but with the possibility of adding many more functionalities in the future. The requirements are as follow
• The server maintains a file of the time differences between South Africa and at least 30 other cities in the World.: e.g. Missouri, Tokyo, Kinshasa, Lubumbashi, Kigali, Yaoundé, Melbourne, Stockholm, Brussels, Paris, Laval, Montreal, Toronto, Quebec, Vancouver, etc.
• The client maintains a file of meetings scheduled in different cities which includes the dates of the meetings, the cities’ names, the topic of the meetings, and the platform to be used. The client process will read the file of meetings and submit time conversion requests to the server. The platform may be Zoom, Meet, and Teams. Each request is read from the file of the meetings and has the format:
o Date, City, Time, Topic, Platform
Where the Date is the date in the organizing City and the time is also the time in the organizing city.
• The server’s response will have a similar format to the request but the South African Date and Time. Note that due to time differences, the Date in a city around the world may differ from the Date in South Africa. Each request is read from the file of the meetings and has the format:
o Date, City, Time, Topic, Platform
Where the Date is the date in South Africa and the City is the city in South Africa.
# tcp-server.py
from socket import *
# create the socket
# AF_INET == ipv4
# AF_INET6 == ipv6
# SOCK_STREAM == TCP
serverPort = 12000
serverSocket = socket(AF_INET,SOCK_STREAM)
#bind a socket to some port on the server
serverSocket.bind(("",serverPort))
serverSocket.listen(5)
print ("The server is ready to receive")
while True:
connectionSocket, addr = serverSocket.accept()
sentence = connectionSocket.recv(1024).decode()
capitalizedSentence = sentence.upper()
connectionSocket.send(capitalizedSentence.encode())
connectionSocket.close()
# tcp-client.py
from socket import *
serverName = "127.1.1.0"
serverPort = 12000
clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.connect((serverName,serverPort))
sentence = input("Input lowercase sentence:")
print (sentence)
#text = raw_input("Enter a Letter: ").lower() print text
clientSocket.send(sentence.encode())
modifiedSentence = clientSocket.recv(1024)
print ("From Server:", modifiedSentence.decode())
clientSocket.close()
30 countries to use.
Belo Horizonte Gaborone Francistown Molepolole Shanghai Guangzhou Beijing Havana Santiago de Cuba Holguín Copenhagen Aarhus Odense Cairo Giza Alexandria Helsinki Espoo Tampere Paris
Step by step
Solved in 4 steps with 4 images