Sockets and Groups

Eugenio Flores <[email protected]> Mon, 20 Feb 2006 12:51:44 -0600 (CST)
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
Hello Group.
   
  I got a conceptual doubt about joining groups and JXTASockets:
   
  I have two applications (You know that already), the first one has a JxtaServerSocket, but first it creates a group. Then I declare the JxtaServerSocket in the scope of this group, instead of doing it in the scope of the netGroup:
   
  myGroup = PeerGroupFactory.newNetPeerGroup();
  private PeerGroup pg = null;
  private PeerGroupAdvertisement advPG = null;//I assign advPG when I look for the group advertisement locally
  JxtaServerSocket serverSocket;
  pg = myGroup.newGroup(advPG);
  serverSocket = new JxtaServerSocket(pg, this.pipeAdv,10);
   
  The other application has a JxtaSocket, but first it finds the group advertisement published by the first application, afterward it instantiates that group. Finally I create the JxtaSocket in the scope of this group.
   
   socket = new JxtaSocket(pg,
                                //no specific peerid
                                null,
                                pipeAdv,
                                //general TO: 30 seconds
                                30000,
                                // reliable connection
                                true);
   
  Both application work fine, they communicate with each other well, but the second application did not have to join the group created in the JXTAServer application. As I told you, I just instantiate! , in the second application, the group that it finds and creates the JxtaSocket with this group. So now I wonder in what kind of cases it is necessary to join a group.
   
  Could you help me with this doubt?
   
  Thanks a lot again.



		
---------------------------------
  Do You Yahoo!? La mejor conexión a Internet y 2GB extra a tu correo por $100 al mes. http://net.yahoo.com.mx