Link to home
Start Free TrialLog in
Avatar of cnjmorris
cnjmorris

asked on

Client/Server - sending IP

I am trying to make it so that when a friend install a file on his computer and I install another on mine they can communicate.

I have not yet decided who is going to be the server and who is the client... not that it matters too much since mostly that is symantics. The problem that I have is that neither of us are on a static IP, they are assigned by our ISP providers (though I have had the same IP for weeks, it DOES change from time to time).

Is there a good way for one to connect to the other without knowing the IP?  I was thinking, it is poosible for one of the programs to make a text file <computername>.txt , have it contain the ip of the computer, and upload that file to a web site using ftp?

Is that possible and if so is it possible for the other persons computer to periodically check that site, compare current IP and see if it has changed, updating if it has?

I am trying to make it so that both computers actively try to keep a connection so that I can access files from his PC, and he from mine at all times.

I know running a server would be easier but I don't know how to run a server and thought this would give me some practice coding.

Thanks.
Avatar of BozzoCage
BozzoCage

One simple solution: if you have access to some FTP server, let client connects to it and write it's IP to some file. When another client connects, let it first check if file exists, then DL it and use IP. If file does not exists, then it is the first one and will write a file with own IP.

You could do similar with IRC servers (just go to some private channel), but since you are going to do file transfers, you probably know how to use ftp through VB.

Regards,
  BozzoCage
Avatar of cnjmorris

ASKER

I am actually self taught in VB and up till now I have focused mostly on SQL and DAO (need to force myself to learn the more verstaile and modern ADO soon) so I don't know anything about FTP in VB.  If FTP is the best solution then I will start looking for samples of that.  I don't mind doing leg work, more often then not I need concept help more than coding help.

If anyone has other ideas on alternate routes, or more on this route PLEASE offer your comments =)
I try to write a program to upload a text file or html file to a server.  Then, another program will download it, retrieve IP address inside and try to connect.  It work.

The problem is, if more than one person upload at the same time, it might have problem.  Therefore, it cannot support multiple user.

If we can run CGI program or access a database file in server, i think should be able to solve this problem.

Any good idea for me? ^^
yongyih, then use 2 files - one would mean presence of another user (just like a True/False value), another will be for real data.
I doubt 2 users would create "presence" file at once... but if, make that file read-only. One user (program) will surely fail to write to it.
Yongyih

Could you send me the program that uploads the text file and the one that retrieves? Would greatly reduce my work. Thanks.
Sorry cnjmorris, i wrote that program long time ago.  I lost it after i format my hard disk.

I also forgot the web site that i used to upload file.
Do you think can upload file to geocities or not?

Yes you can upload to Geocities just as you would any other ftp server, though I am currently looking into how that is done.

To FTP to geocities its:

host:        ftp.geocities.com
user:        your yahoo id
password:    your yahoo password
<ping>
Yes you can upload to Geocities just as you would any other ftp server, though I am currently looking into how that is done.

To FTP to geocities its:

host:        ftp.geocities.com
user:        your yahoo id
password:    your yahoo password
Yes you can upload to Geocities just as you would any other ftp server, though I am currently looking into how that is done.

To FTP to geocities its:

host:        ftp.geocities.com
user:        your yahoo id
password:    your yahoo password
Yes you can upload to Geocities just as you would any other ftp server, though I am currently looking into how that is done.

To FTP to geocities its:

host:        ftp.geocities.com
user:        your yahoo id
password:    your yahoo password
ASKER CERTIFIED SOLUTION
Avatar of Corvax021899
Corvax021899

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial