|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An RMStreamSocket represents a stream-oriented connection to a multicast transport session. Some transports may not support stream-oriented connections. Those that do must define at least one class that implements the RMStreamSocket interface. This class may have additional transport specific methods, but must support the minimal methods defined in this interface.
The most common way to use an RMStreamSocket is to receive a
TransportProfile describing a multicast transport session and call its
createRMStreamSocket
method. This will return a transport
specific object that implements the RMStreamSocket interface. The methods
of this interface can be used to send and receive data or change or
monitor the multicast transport session.
To send data, use the getOutputStream
method to get an
OutputStream object. Then use the methods of that class (or other classes
like PrintWriter) to write data to the multicast transport session.
To receive data, use the getInputStream
method to get
an InputStream object. Then use the methods of that class (or other
classes like StringReader) to read data from the multicast transport
session.
Most transports will want to create a class that implements the RMStreamSocket interface. This interface provides a simple way to access multicast transports. However, it does require that the transport handle ordering and repair of data in order to deliver data to receivers in the same order that it was sent.
More sophisticated applications may want to use the RMPacketSocket interface to gain access to the more advanced capabilities that it offers (out of order delivery and support for multiple senders, for instance).
Method Summary | |
void |
abort()
Leaves the multicast transport session as quickly as possible. |
void |
close()
Leaves the multicast transport session gracefully. |
java.io.InputStream |
getInputStream()
Returns an InputStream object for receiving data from this multicast transport session. |
java.net.InetAddress |
getInterface()
Returns the address of the network interface used for sending data over the multicast transport session. |
java.io.OutputStream |
getOutputStream()
Returns an OutputStream object for sending data over this multicast transport session. |
RMStatistics |
getRMStatistics()
Retrieve the RMStatistics Block of this socket. |
TransportProfile |
getTransportProfile()
Retrieve the transport profile this socket is currently using. |
void |
setInterface(java.net.InetAddress ia)
Sets the address of the network interface used for sending data over the multicast transport session. |
Method Detail |
public java.io.InputStream getInputStream() throws UnsupportedException, RMException, java.io.IOException
UnsupportedException
- if the transport does not
support getting the interfaceRMException
- if a reliable-multicast-related exception occurspublic java.io.OutputStream getOutputStream() throws UnsupportedException, RMException
UnsupportedException
- if the transport does not
support getting the interfaceRMException
- if a reliable-multicast-related exception occurspublic void abort()
public void close()
public java.net.InetAddress getInterface() throws java.net.SocketException, UnsupportedException, RMException
java.net.SocketException
- if an error occursUnsupportedException
- if the transport does not
support getting the interfaceRMException
- if a reliable-multicast-related exception occurspublic void setInterface(java.net.InetAddress ia) throws java.net.SocketException, UnsupportedException, RMException
ia
- the address of the network interface for outgoing data.java.net.SocketException
- if an error occursUnsupportedException
- if the transport does not
support setting the interfaceRMException
- if a reliable-multicast-related exception occurspublic TransportProfile getTransportProfile()
getTransportProfile
method.public RMStatistics getRMStatistics() throws UnsupportedException
UnsupportedException
- when transport does not support this.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.