com.limegroup.gnutella
Class MulticastService

java.lang.Object
  extended bycom.limegroup.gnutella.MulticastService
All Implemented Interfaces:
java.lang.Runnable

public final class MulticastService
extends java.lang.Object
implements java.lang.Runnable

This class handles Multicast messages. Currently, this only listens for messages from the Multicast group. Sending is done on the GUESS port, so that other nodes can reply appropriately to the individual request, instead of multicasting replies to the whole group.

See Also:
UDPService, MessageRouter

Method Summary
static MulticastService instance()
          Instance accessor.
 boolean isListening()
          Returns whether or not the Multicast socket is listening for incoming messsages.
 void run()
          Busy loop that accepts incoming messages sent over the multicast socket and dispatches them to their appropriate handlers.
 void send(Message msg)
          Sends the Message using UDPService to the multicast address/port.
 void start()
          Starts the Multicast service.
 java.lang.String toString()
          Overrides Object.toString to give more informative information about the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

instance

public static MulticastService instance()
Instance accessor.


start

public void start()
Starts the Multicast service.


run

public void run()
Busy loop that accepts incoming messages sent over the multicast socket and dispatches them to their appropriate handlers.

Specified by:
run in interface java.lang.Runnable

send

public void send(Message msg)
Sends the Message using UDPService to the multicast address/port.

Parameters:
msg - the Message to send

isListening

public boolean isListening()
Returns whether or not the Multicast socket is listening for incoming messsages.

Returns:
true if the Multicast socket is listening for incoming Multicast messages, false otherwise

toString

public java.lang.String toString()
Overrides Object.toString to give more informative information about the class.

Returns:
the MulticastSocket data