lcm.lcm
Interface Provider

All Known Implementing Classes:
LogFileProvider, TCPProvider, UDPMulticastProvider

public interface Provider

A provider implements a communications modality for LCM. (I.e., a URL handler.) The provider should call LCM.receiveMessage() upon receipt of a message. LCM.receiveMessage() is thread-safe and can be called from any thread.


Method Summary
 void close()
          close() will be called when the application no longer requires the provider and wishes to free the resources used by the provider.
 void publish(java.lang.String channel, byte[] data, int offset, int len)
          Publish() will be called when an application sends a message, and could be called on an arbitrary thread.
 void subscribe(java.lang.String channel)
          subscribe() will be called when a channel subscription has been made.
 void unsubscribe(java.lang.String channel)
          unsubscribe() will be called when a channel subscription is cancelled.
 

Method Detail

publish

void publish(java.lang.String channel,
             byte[] data,
             int offset,
             int len)
Publish() will be called when an application sends a message, and could be called on an arbitrary thread.


subscribe

void subscribe(java.lang.String channel)
subscribe() will be called when a channel subscription has been made. Providers that do not use a broadcast communications mechanism could use this notification to establish communications with additional hosts.


unsubscribe

void unsubscribe(java.lang.String channel)
unsubscribe() will be called when a channel subscription is cancelled.


close

void close()
close() will be called when the application no longer requires the provider and wishes to free the resources used by the provider. For example, file handles and network sockets should be closed. After this method is called, the results of any calls to publish or subscribe are undefined.