Update of Port number setting function.