![]() ![]() ![]() If you call the Connect method, any datagrams that arrive from an address other than the specified default will be discarded. Once you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation for a detailed description of the error. If you receive a SocketException, use SocketException.ErrorCode to obtain the specific error code. If you have established a default remote host and you also provide a remote host in your call to the Send method, Send will throw a SocketException. If you want to send datagrams to a different remote host, you must make another call to the Connect method or create another UdpClient without a default remote host. Specifying a default remote host limits you to that host only. Once established, you do not have to specify a remote host in each call to the Send method.Įstablishing a default remote host is optional. The Connect method establishes a default remote host using the value specified in the endPoint parameter. 'Uses a remote endpoint to establish a socket connection.ĭim ipAddress As IPAddress = Dns.Resolve("Dim ipEndPoint As New IPEndPoint(ipAddress, 11004) IPAddress ipAddress = Dns.Resolve("IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, 11004) Uses a remote endpoint to establish a socket connection. IPEndPoint^ ipEndPoint = gcnew IPEndPoint( ipAddress,11004 ) IPAddress^ ipAddress = Dns::Resolve( ")->AddressList The following example uses an IPEndPoint to establish a default remote host. ![]()
0 Comments
Leave a Reply. |