Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetEndpoint()

IPEndPoint System.Net.Sockets.UdpClient.GetEndpoint ( string hostname,
int port )
inlineprivate

Definition at line 273 of file UdpClient.cs.

274 {
275 if (_active && (hostname != null || port != 0))
276 {
278 }
279 IPEndPoint result = null;
280 if (hostname != null && port != 0)
281 {
282 IPAddress[] hostAddresses = Dns.GetHostAddresses(hostname);
283 int i;
284 for (i = 0; i < hostAddresses.Length && !IsAddressFamilyCompatible(hostAddresses[i].AddressFamily); i++)
285 {
286 }
287 if (hostAddresses.Length == 0 || i == hostAddresses.Length)
288 {
289 throw new ArgumentException(System.SR.net_invalidAddressList, "hostname");
290 }
291 CheckForBroadcast(hostAddresses[i]);
292 result = new IPEndPoint(hostAddresses[i], port);
293 }
294 return result;
295 }
void CheckForBroadcast(IPAddress ipAddress)
Definition UdpClient.cs:207
bool IsAddressFamilyCompatible(AddressFamily family)
Definition UdpClient.cs:161
static string net_invalidAddressList
Definition SR.cs:42
static string net_udpconnected
Definition SR.cs:30
Definition SR.cs:7

References System.Net.Sockets.UdpClient._active, System.Net.Sockets.UdpClient.CheckForBroadcast(), System.Net.Dns.GetHostAddresses(), System.Net.Sockets.UdpClient.IsAddressFamilyCompatible(), System.SR.net_invalidAddressList, and System.SR.net_udpconnected.

Referenced by System.Net.Sockets.UdpClient.BeginSend(), System.Net.Sockets.UdpClient.Send(), System.Net.Sockets.UdpClient.Send(), System.Net.Sockets.UdpClient.SendAsync(), and System.Net.Sockets.UdpClient.SendAsync().