Suppose that in UDPClient.py, after we create the socket, we add the line: clientSocket.bind(('', 5432))
Will it become necessary to change UDPServer.py? What are the port num- bers for the sockets in UDPClient and UDPServer? What were they before making this change?
Refer chapter 2, section 2.7.1 of textbook for complete code of the UDPClient.py :
Moidfied code:
from socket import *
.
.
#write the remaining code here
.
.
clientSocket = socket(socket.AF_INET, socket.SOCK_DGRAM)
clientSocket.bind((‘ ’, 5432))
message = raw_input(‘Input lowercase sentence:’)
.
.
#write the remaining code here
.
.
clientSocket.close()
After modifications then the Port numbers of client and server:
DP Client port number - 5432
UDP Server port number - 12000
Before modifications the Port numbers of client and server :
UDP Client port number - xxxx (number assigned by OS)
UDP Server port number - 12000