Question

Chrisz

Member
Joined
Oct 24, 2003
Messages
7
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. :P

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:
What is the localhosts 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?
 
Im 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 by a moderator:
Back
Top