|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cycling74.net.MultiReceiver
public class MultiReceiver
Connect to and receive from multicast groups. An internal Callback is maintained from a specified method name and object. The specified method must take an array of Atoms as its only argument. When data is received, it is translated to an array of Atoms and passed to the specified method. When a MultiReceiver is no longer needed its close() method should be called. created on 18-May-2004
Constructor Summary | |
---|---|
MultiReceiver()
Creates a new MultiReceiver. |
|
MultiReceiver(int port)
Creates a new MultiReceiver connected to a specified port. |
|
MultiReceiver(java.lang.String groupName,
int port)
Creates a new MultiReceiver connected to a specified group and port. |
|
MultiReceiver(java.lang.String groupName,
int port,
java.lang.Object toCallIn,
java.lang.String methodName)
Creates a new MultiReceiver connected to a specified group and port, and creates an internal callback to a given method. |
Method Summary | |
---|---|
void |
close()
Close down the MultiReceiver. |
java.lang.String[] |
getGroups()
|
int |
getPort()
|
void |
join(java.lang.String name)
Join a multicast group. |
void |
leave(java.lang.String name)
Leave one group. |
void |
leaveAllGroups()
Leave all groups. |
void |
run()
|
void |
setActive(boolean b)
Turn the MultiReceiver on or off. |
void |
setCallback(java.lang.Object toCallIn,
java.lang.String methodName)
Creates and maintains a Callback for the MultiReceiver. |
void |
setDebugString(java.lang.String name)
Sets the debug string to be used for purposes of error reporting. |
void |
setPort(int port)
Sets the port to listen to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiReceiver()
public MultiReceiver(java.lang.String groupName, int port, java.lang.Object toCallIn, java.lang.String methodName)
groupName
- the group to joinport
- port to communicate overtoCallIn
- object that contains the method to callmethodName
- method to callpublic MultiReceiver(java.lang.String groupName, int port)
groupName
- the group to joinport
- port to communicate overpublic MultiReceiver(int port)
port
- port to communicate overMethod Detail |
---|
public void setPort(int port)
port
- the new portpublic int getPort()
public void setCallback(java.lang.Object toCallIn, java.lang.String methodName)
toCallIn
- object that contains the methodmethodName
- method to callpublic void setActive(boolean b)
b
- true to turn it onpublic java.lang.String[] getGroups()
public void join(java.lang.String name)
name
- the name of the group to join. eg 224.74.74.74 (the maxhole group)public void run()
run
in interface java.lang.Runnable
public void close()
public void leaveAllGroups()
public void leave(java.lang.String name)
name
- the group to leavepublic void setDebugString(java.lang.String name)
name
- the debug string to use when error reporting
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |