hi, im trying to make a simple connection with a friend using port 8080, but
for some reason the other computer always refuses connection, even if they
disable their firewall....heres my code, any help would b awsome
Dim localIp As Net.IPAddress
Dim connection As New Net.Sockets.TcpClient
Dim reg As Registry
''this is to find the local ip, i dont kno if it works, so if anyone could
help with that ''too
Dim rk As RegistryKey =
reg.LocalMachine.OpenSubKey("System\CurrentControl Set\Services\Tcpip\Parameters\Interfaces\{06ECB9C5-1DF8-481F-AB69-3C181F4A7}")
Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Call connect()
End Sub
Sub connect()
Dim netstream As Net.Sockets.NetworkStream
Try
connection.Connect(IP TO SEND GOES HERE, 8080)
MsgBox("Connection Made")
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
localIp = localIp.Parse(rk.GetValue("DhcpIPAddres", ""))
Catch ex As Exception
MsgBox(ex.Message)
End Try
Dim listen As New Net.Sockets.TcpListener(localIp, 8080)
listen.Start()
End Sub
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
localIp = localIp.Parse(rk.GetValue("DhcpIPAddres", ""))
Dim listen As New Net.Sockets.TcpListener(localIp, 8080)
connection.Close()
listen.Stop()
End Sub