Java Socket - Local Port

It is a local socket port number. It is usually assigned by the system.

See What is a Socket?.

On the client-side: The client knows the hostname of the machine on which the server is running and the port number on which the server is listening. To make a connection request, the client tries to rendezvous with the server on the server's machine and port. The client also needs to identify itself to the server so it binds to a local port number that it will use during this connection. This is usually assigned by the system.

As to the second question:

I assume this IP address is what you get by your DNS server when you lookup www.nba.com (mine is different). The problem might be that the HTTP server at this address serves multiple virtual hosts and/or it cares about the Host header your browser sends. In your case it is the IP address instead of www.nba.com.

Tags:

Sockets

Java