Results 1 to 3 of 3
  1. #1
    moon is offline Member
    Join Date
    Sep 2009
    Rep Power

    Post 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 !!

  2. #2
    r035198x is offline Senior 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.

  3. #3
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    San Jose, CA, USA
    Rep Power


    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: JXTA
    My Hobby Project: LegacyClone

Similar Threads

  1. how to send data to network printer
    By santhosh_el in forum AWT / Swing
    Replies: 3
    Last Post: 10-06-2009, 02:21 PM
  2. problem data send from network
    By MS_Dark in forum Networking
    Replies: 1
    Last Post: 06-30-2009, 09:32 AM
  3. Monitoring the network
    By khajalid in forum Threads and Synchronization
    Replies: 1
    Last Post: 12-21-2008, 10:22 AM
  4. P2P network in Java
    By john1984 in forum Networking
    Replies: 10
    Last Post: 10-01-2008, 09:22 PM
  5. Transferring Over Network
    By qwerty in forum Advanced Java
    Replies: 2
    Last Post: 08-01-2008, 02:40 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts