Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to share data between two users through internet. How ca i do that?
Posted

1 solution

You have essentially 2 choices that fit with the internet model.

1. Client Server. You find an internet service provider that runs or will run a piece of server software, like the Apache Web Server for example, which will allow connections to be made to it over the internet and data to be sent and recieved. 2 or more Clients can then connect to this server and exchange data with it and ultimately with one another. Now you have Facebook!

2. Peer to Peer. You make the Client Part and a small Server Part in one piece of software. Each user runs the software and a peer-to-peer network of sender/recievers is formed by all the running instances. Now you have BitTorrent!

The actual sending and recieving part is done with a set of technologies called the OSI stack. You'll already know about one of them, IP (Internet Protocol) because without an IP address you couldn't be online posting questions to Code Project.
At the top of the protocol stack, above IP and TCP (Transmision Control Protocol) in what is called the application layer are technologies like Sockets.

You can use Socket programming to send and recieve data over the internet in a way that makes it very very similar to reading and writing a file, except the 'file' is really a connection to another computer at the IP address you use to set up the socket.

There are loads of books and more stuff online about this than you could read in a 100 years. Google for a simple Chat program in your programming technology of choice to get started. Sockets are a great technology to master especially if you want to get paid for writing code. :-)
 
Share this answer
 
Comments
anonymous10 3-Feb-13 13:55pm    
Can you please give me programming sample with little bit explanation.
Matthew Faithfull 3-Feb-13 14:04pm    
OK I did the googling for you and the first one I hit was right here on Code Project
http://www.codeproject.com/Articles/524066/SignalR-Simple-Chat-Application-in-Csharp
It's got a good rating and I'm sure there are many more. If you have questions about this or any other article please ask the author as I haven't read it.
Enjoy.
Alamgirable 4-Feb-13 5:49am    
i need c++ help not c#.
Matthew Faithfull 4-Feb-13 5:56am    
Google says this might help you
http://www.codeproject.com/Articles/14032/Chat-Client-Server
Sergey Alexandrovich Kryukov 3-Feb-13 20:41pm    
Strictly speaking network applications are not classified into "client-server" and "peer-to-peer". Both concepts are just some conceptions representing some special cases. Very limiting, by the way...
—SA

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