Direct IP connection fix
This commit is contained in:
parent
fae7349356
commit
f23ed8caa6
|
@ -53,12 +53,15 @@ Namespace Servers
|
|||
Try
|
||||
Dim connectIP As IPAddress = Nothing
|
||||
|
||||
For Each IPAddress In System.Net.Dns.GetHostEntry(Server.IP).AddressList
|
||||
If IPAddress.AddressFamily = AddressFamily.InterNetwork Then
|
||||
connectIP = IPAddress
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not IPAddress.TryParse(Server.IP, connectIP) Then
|
||||
For Each IPAddress In Dns.GetHostEntry(Server.IP).AddressList
|
||||
If IPAddress.AddressFamily = AddressFamily.InterNetwork Then
|
||||
connectIP = IPAddress
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
Me._client.Connect(connectIP.ToString, CInt(Server.Port))
|
||||
|
||||
|
|
|
@ -466,12 +466,14 @@ Public Class JoinServerScreen
|
|||
|
||||
Dim connectIP As IPAddress = Nothing
|
||||
|
||||
For Each ipaddress In System.Net.Dns.GetHostEntry(Me.IP).AddressList
|
||||
If ipaddress.AddressFamily = AddressFamily.InterNetwork Then
|
||||
connectIP = ipaddress
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not IPAddress.TryParse(IP, connectIP) Then
|
||||
For Each ipaddress In Dns.GetHostEntry(IP).AddressList
|
||||
If ipaddress.AddressFamily = AddressFamily.InterNetwork Then
|
||||
connectIP = ipaddress
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
sw.Start()
|
||||
client.Connect(connectIP, CInt(Me.Port))
|
||||
|
|
Loading…
Reference in New Issue