I don't know why it's obsolete, but this is how one create an instance of IpAdresse
.
Dim ip As IPAddress = IPAddress.Parse("0.0.0.0")
Dim port As Integer = 6335
Dim listener As New TcpListener(ip, port)
Pergunta
i am trying to make a simple chat program in VB.net but when I define a tcplistener as any tutorial has done by:
Dim Listener As New TcpListener(6335)
i get the error message:
Public Sub New(port As Integer)' is obsolete: 'This method has been deprecated. Please use TcpListener(IPAddress localaddr, int port) instead. http://go.microsoft.com/fwlink/?linkid=14202'.
i do not understand the purpose behind this new way of doing it but I also do not know how to both get the local address and use the data type "IPaddress" can anybody explain?
Solução
I don't know why it's obsolete, but this is how one create an instance of IpAdresse
.
Dim ip As IPAddress = IPAddress.Parse("0.0.0.0")
Dim port As Integer = 6335
Dim listener As New TcpListener(ip, port)