2023-06-12 07:10 AM
I am using an stm32h23zg, FreeRTOS plus TCP stack to create a TCP client.
I checked, I can bind the socket to many values (tried 1, 52 and 1000, all 3 worked) but I couldn't find any recommendation on which port to use.
On computers it is usually recommended to use ports over 50000 as they are specificaly made for "free use" (while the previous ones have a specific use and shouldn't be touched by a lmabda user).
I looked only. no results.
This guide uses port 7 : https://www.youtube.com/watch?v=KXS7HqmcWpk
This guide uses port 5000 : https://www.carminenoviello.com/2015/08/28/adding-ethernet-connectivity-stm32-nucleo/
Is there any recommendation on which port number to use for a TCP connection?
Solved! Go to Solution.
2023-06-12 03:57 PM
It's really up to you. Usually it's best to avoid common ports (e.g. 80 for HTTP) since they may be in use already by the remote device.
https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
2023-06-12 03:57 PM
It's really up to you. Usually it's best to avoid common ports (e.g. 80 for HTTP) since they may be in use already by the remote device.
https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers