|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object maslab.telemetry.JugClient
public class JugClient
Manages sending and receiving packets via a hub for inter-process/inter-robot communication.
Constructor Summary | |
---|---|
JugClient()
Create a new client and connect to the hub on localhost using the default TCP port |
|
JugClient(java.net.InetAddress addr,
int port)
Create a new client and connect to the hub on the specified host and port. |
Method Summary | |
---|---|
void |
addStatusListener(StatusListener listener)
Add a StatusListener who will be notified of connection/disconnection events and new channel events. |
void |
advertise(java.lang.String channel)
Advertise the existence of a new channel. |
void |
displayQueueSizes()
As a debugging aid, dump the sizes of each queue to stdout. |
java.util.ArrayList<java.lang.String> |
getChannels()
Get a list of all channels which are currently advertised. |
void |
publish(java.lang.String channel,
byte[] data)
Publish data on a previously advertised channel. |
boolean |
publishing(java.lang.String channel)
Determine if a message would actually be sent on a channel. |
void |
reconnect(java.net.InetAddress addr,
int port)
|
void |
removeStatusListener(StatusListener listener)
Remove a StatusListener |
void |
setMaximumQueueSize(java.lang.String channel,
int size)
Limit the number of messages that can be queued up on a particular channel. |
void |
subscribe(java.lang.String cname,
JugMessageListener listener)
Subscribe to a channel. |
void |
unadvertise(java.lang.String channel)
Unadvertise a channel. |
void |
unsubscribe(java.lang.String cname,
JugMessageListener listener)
Unsubscribe to a channel. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JugClient()
public JugClient(java.net.InetAddress addr, int port) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void reconnect(java.net.InetAddress addr, int port) throws java.io.IOException
java.io.IOException
public void addStatusListener(StatusListener listener)
public void removeStatusListener(StatusListener listener)
public java.util.ArrayList<java.lang.String> getChannels()
public void subscribe(java.lang.String cname, JugMessageListener listener)
cname
- The name of the channel.listener
- The listener to be notified of received data.public void unsubscribe(java.lang.String cname, JugMessageListener listener)
cname
- The name of the channel.listener
- The listener that was subscribedpublic void advertise(java.lang.String channel)
channel
- The channel name that you will be publishing
on.public void unadvertise(java.lang.String channel)
channel
- The channel name that you will no longer be
publishing onpublic void publish(java.lang.String channel, byte[] data)
channel
- The channel name.data
- The data (opaque) to be sent. The data is NOT
copied and thus should not be modified.public void setMaximumQueueSize(java.lang.String channel, int size)
channel
- The channel namesize
- The maximum number of bytes before new published
messages are dropped. If the size is less than zero, no limit
is enforced.public void displayQueueSizes()
public boolean publishing(java.lang.String channel)
channel
- The channel name.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |