- All Superinterfaces:
- Connection, InputConnection, IRadioControl, ITimeoutableConnection, OutputConnection, StreamConnection
- All Known Subinterfaces:
- All Known Implementing Classes:
public interface RadiostreamConnection
- extends ITimeoutableConnection, IRadioControl, StreamConnection
This interface defines the "radio" protocol.
The radio protocol is a socket-like peer-to-peer protocol that provides reliable, buffered
stream-based IO between two devices.
IMPORTANT This protocol is provided for test purposes and to allow creation of simple
demonstrations. It is NOT designed to be used as the base for higher level or more complex
protocols. If you want to create something more sophisticated write a new protocol that
class directly. See
IProtocolManager for more information.
To open a connection do:
StreamConnection conn = (StreamConnection) Connector.open("radiostream://destinationAddr:portNo");
where destinationAddr is the 64 bit IEEE Address of the radio at the far end, and portNo is a
port number in the range 0 to 127 that identifies this particular connection. Note that 0 is not
a valid IEEE address in this implementation.
To establish a bi-directional connection both ends must open connections specifying the same portNo
and corresponding IEEE addresses.
Once the connection has been opened, each end can obtain streams to use to send and receive data, eg:
DataInputStream dis = conn.openDataInputStream();
DataOutputStream dos = conn.openDataOutputStream();
Copyright © 2007 Sun Microsystems, Inc. All Rights Reserved.