Question

Chrisz

Newcomer
Joined
Oct 24, 2003
Messages
7
My program wont let me connect to anything BUT 192.*.*.* IP's 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. :P

The client code:

Visual Basic:
  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:

Visual Basic:
  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:
What is the localhost's IP address? Can you access computers on the internet with other applications IE, ftp etc?

Also if you drop to a command propmpt and type

ipconfig /all

do you have entries for the default gateway?
 
I'm not sure about FTP, since my webhost is down.. and as for the ipconfig stuff.. i have a one default gateway entry and the rest are blank o.o
 
Where is the computer located - at home / work / school etc?
Also do you know if there are any .Net security policies in place on that PC. Have a look under Administrative Tools, .Net configuration.
 
Last edited:
Back
Top