• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DatagramPacket with more than one group

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can i add more than one group in DatagramPacket. I tryed with array like that..

but no success. When the array ends gives Exception java.lang.ArrayIndexOutOfBoundsException . So what is the deal here, can it be done without loop or with it, but the array to be looping throw some groups ? the str[i] contains bunch of a ip's like 255.0.0.1 and etc .
 
Rancher
Posts: 1776
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jahar Heard wrote:



Hi i dont know about the DataGramPacket technology. But can you try modifying the for loop like below and check?



 
Jahar Heard
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lol worked ... FIxed the array error, but does anyone has information about the Packets how can i send endless groups to them i mean endless loop with groups ?
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jahar Heard wrote:Lol worked ... FIxed the array error, but does anyone has information about the Packets how can i send endless groups to them i mean endless loop with groups ?



what you mean by endless loop with group???
while(ture){
//will run endless, but why do you need to run endless loop?, please explain the business objective for your requirement which will help us to provide better solution
}
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By group, I am assuming that you mean multicast group. Not sure of any other networking term with "group" in it; and related to datagram packets.

Even so, "datagrampacket with more than one group" doesn't make sense. Datagrams are put on transports (even multicast transports). There is no datagram packet with groups.

We definitely need more info here.
Henry
 
Jahar Heard
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK so here is the thing i'm trying to do. PHP client to client passing through java server. I can't figure it out how can i join a multicast group in java from php client socket.. just.. Any ideas, or something that is near to my thought.
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jahar Heard wrote:OK so here is the thing i'm trying to do. PHP client to client passing through java server. I can't figure it out how can i join a multicast group in java from php client socket.. just.. Any ideas, or something that is near to my thought.



Your followup question seems simple enough -- you want to communicate with another client. What have you tried so far with the java.net.MulticastSocket class? What you described should work -- just join the same multicast group as the PHP client, and as long as the switches and routers routes the datagrams, you should be able to send and receive.

Henry
 
reply
    Bookmark Topic Watch Topic
  • New Topic