Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

Ihave a remote desktop program that does not use winstock or any other fancey stuff. i need it to be as basic as possible.
So far my project only views the other computer connected (the desktop of the other system). This works very well and fast but i desperately need to find out how to connect over live networks like the internet.
My project can connect to comupters on my home network only but this is no use.

I have a server and a client module but they only connect on local networks.

If any of you have any suggestions i would be greatfull.

some of my code is........

VB
Dim CLIENT As New TcpClient
  Dim SERVER As New TcpListener(8085)
  Dim Nstream As NetworkStream
  Dim LIstening As New Thread(AddressOf listen)
  Dim GetImage As New Thread(AddressOf recieveImage)

  Private Sub btnConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)   Handles btnConnect.Click
      Try
          CLIENT.Connect("127.0.0.1", 8085)
      Catch ex As Exception
          MsgBox("Connection failure...")
      End Try
  End Sub



C# examples would be useful also.
thank u in advance
Posted
Updated 6-Nov-12 9:35am
v2
Comments
fjdiewornncalwe 6-Nov-12 13:48pm    
So, basically you want us to do your homework for you.
Ed Nutting 6-Nov-12 13:56pm    
Or the OP has totally failed to realise that he could just change the IP address from a local address to his external address and unblock ports on firewall & router (and possibly needs a port forward)...I wonder if the OP reeaallyy understands what his code is doing? :/
ExcelledProducts 6-Nov-12 14:26pm    
I think so Marcus :)

1 solution

As Ed pointed out, you need to change your IP address in the line
VB
CLIENT.Connect("127.0.0.1", 8085)

to be the public IP address of the machine you want to connect to like so:
VB
CLIENT.Connect("85.37.21.143", 8085)

You will also need to set up port forwarding on your client's router to forward that port to the appropriate internal machine. Finally, you will need to make sure that all the firewalls (at the router and at the PC level) allow that traffic to flow through unhindered.

This isn't really a programming problem but rather a network configuration issue. You need to set your router up properly (at the destination end) and then you will be fine (once you change the IP address).
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900