Results 1 to 3 of 3
- 09-21-2009, 05:50 AM #1Member
- Join Date
- Sep 2009
- Rep Power
How to sends data over network ?Help me!!
Hi ,I am beginner of learning Java Networking.I want to connect 3 or more computers. One for server and others(eg A and B )for clients .But I want to connect
1.A to Server and vise versa
2.B to Server and vise versa
3.A to B and vise versa.
First I want to send message from either A or B to server and server sends stored data to sender(eg A ) and sender (A ) will connect to B .Then A and B will confirm message and A and B will send data one to another.But this occasion can occurs from A and B concurrently.
But I just learned simple code for connection of one server and one client using Server socket and socket . Will all 3 computers require to act for both server and client ?Is there other ways to connect between clients . I don't know how to consider to solve data conflict between computers . I also want to satisfy if new clients are added . If anyone know to solve above problem including data conflicts ,pls help me with simple sample code for both server and clients . Thanks !!
- 09-21-2009, 09:12 AM #2Senior Member
- Join Date
- Aug 2009
- Rep Power
Typically you would have one server and multiple clients. The clients would be communicating via the server. But it's hard to be certain because you didn't really describe the problem you want to solve. You described how you want to solve the problem instead.
- 09-21-2009, 03:57 PM #3
The easiest solution is to have all the clients send data to the server and then the server sends it to the correct client. Depending on the data, that could be a lot of bandwidth; that is something to consider.
If you try to make the client a server also, you would have to insure that the correct ports are open on the clients machine... which is possible, but asking a lot.
You could try P2P in java: JXTAMy Hobby Project: LegacyClone
- By santhosh_el in forum AWT / SwingReplies: 3Last Post: 10-06-2009, 01:21 PM
- By MS_Dark in forum NetworkingReplies: 1Last Post: 06-30-2009, 08:32 AM
- By khajalid in forum Threads and SynchronizationReplies: 1Last Post: 12-21-2008, 10:22 AM
- By john1984 in forum NetworkingReplies: 10Last Post: 10-01-2008, 08:22 PM
- By qwerty in forum Advanced JavaReplies: 2Last Post: 08-01-2008, 01:40 PM