Adding method to get the socket for accessing the assigned port number