There are three overloads for constructing a TcpListener
:
i want to listen on a particular port, but on all available interfaces. There was an overload available to do that, but it's been marked as obsolete
.
What is the new preferred/non-obsolete way to listen on a particular port on all interfaces with a TcpListener
in .NET?
For helpfulness sake, an IPEndPoint
is:
public IPEndPoint(
IPAddress address,
int port
)
which is what the 3rd overload is. And an IPAddress
takes, as its constructor:
- a
byte[]
- an
Int64
- a
byte[]
and an Int64
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…