My program wont let me connect to anything BUT 192.*.*.* IPs or "localhost" it wont let me connect to my internet ip.... Any ideas?? Btw this function below is called simply with Connect("23.236.236.23") and that ip was just.. random.
The client code:
The server code:
Everything works.. apart from connecting outside my local network. That is connecting to other peoples computers running the server.... Yes they all have the .net framework and such.
The client code:
Code:
Private Function Connect(ByVal IP As String)
On Error GoTo err
mobjClient = New TcpClient(IP, 15200)
DisplayText("Connected to host" & vbCrLf)
mobjClient.GetStream.BeginRead(marData, 0, 1024, AddressOf DoRead, Nothing)
Send("New client online")
Connect = 1
Exit Function
err:
Connect = 0
End Function
The server code:
Code:
Private Sub DoListen()
Try
mobjListener = New TcpListener(15200)
mobjListener.Start()
Do
Dim x As New Client(mobjListener.AcceptSocket)
Dim x As New Client(mobjListener.AcceptTcpClient)
AddHandler x.Connected, AddressOf OnConnected
AddHandler x.Disconnected, AddressOf OnDisconnected
AddHandler x.CharsReceived, AddressOf OnCharsReceived
AddHandler x.LineReceived, AddressOf OnLineReceived
mcolClients.Add(x.ID, x)
Dim params() As Object = {"New connection"}
Me.Invoke(New StatusInvoker(AddressOf Me.UpdateStatus), params)
Loop Until False
Catch
End Try
End Sub
Everything works.. apart from connecting outside my local network. That is connecting to other peoples computers running the server.... Yes they all have the .net framework and such.
Last edited by a moderator: