What port number should I use when testing LAN connections in .NET?

I want to check the connection to a machine on my local intranet. I know the IP address.

What port number should I use? 555? BTW: I am using .NET.

+4
source share
5 answers

You can use any, but avoid "known port numbers"

Read more about such ports here .

+6
source

Ports below 1024 are considered privileged, so they should not be used.

There are several ports above 1024 that are referred to as โ€œwell-knownโ€ ports, so you should probably avoid them. See Ultimate IANA for more details.

And to be completely paranoid safe, take a copy of the sysinternals Tcpview tool to check which ports are used on your machine.

+4
source

The port, as a rule, does not make any difference, since it is not used by any other, and network filtering for this port also does not occur. Usually I chose something random in the thousands, for example 32581

+1
source

Everything above 1024 is good.

The reason for this is that all ports below are reserved for specific protocols or for future use.

0
source

If your goal is to simply open a TCP connection with a Windows machine (XP / Vista / 2003/2008) without standing in front of your own service, you will not break anything if you open (and then close it without sending a message) to port 445 (Windows-DS).

If you want to configure your own server, follow other recommendations regarding unused ports above 1024.

0
source

Source: https://habr.com/ru/post/1277187/


All Articles