Re-implemented the server socket creation and added a function to retreive the port from a sock addr