Which port should be used to transmit TCP packets

Hey, I will send data via Wi-Fi to my computer using Android and java, on my server side (Windows PC) I have this:

serverSocket = new ServerSocket(port); 

And on the client side (Android):

 InetAddress remoteAddr = InetAddress.getByName(SERVERIP); socket = new Socket(remoteAddr, port); 

The question is which port is recommended to use?

+4
source share
2 answers

Select any number / unnamed TCP port number. In particular, this is any number in the range 49152-65535.

At the moment, the IANA page does not work well, but here is a wiki page with the same information.

+3
source

You can use any port you want, except what you can find here

+1
source

All Articles