J
Joey Wu
Dear All
I wrote this function to try to connect 2 devices.
The error message is "inValidCastException".
Please help and thanks a lot!
Public Function Connect(ByVal ServerIP As String, ByVal ServerPort
As Integer) As Boolean
Try
SocClient = New Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.IP)
Dim ep As System.Net.IPEndPoint = New
System.Net.IPEndPoint(IPAddress.Loopback, 16999)
SocClient.Bind(ep)
Dim rEP As System.Net.IPEndPoint = New
System.Net.IPEndPoint(ServerIP, ServerPort)
SocClient.Connect(rEP)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Return SocClient.Connected
End Function
I wrote this function to try to connect 2 devices.
The error message is "inValidCastException".
Please help and thanks a lot!
Public Function Connect(ByVal ServerIP As String, ByVal ServerPort
As Integer) As Boolean
Try
SocClient = New Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.IP)
Dim ep As System.Net.IPEndPoint = New
System.Net.IPEndPoint(IPAddress.Loopback, 16999)
SocClient.Bind(ep)
Dim rEP As System.Net.IPEndPoint = New
System.Net.IPEndPoint(ServerIP, ServerPort)
SocClient.Connect(rEP)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Return SocClient.Connected
End Function