|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An RMPacketSocket represents a packet-oriented connection to a multicast transport session. Some transports may not support packet-oriented connections. Those that do must at least one class that implements the RMPacketSocket 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 RMPacketSocket is to receive a
TransportProfile describing a multicast transport session and call its
createRMPacketSocket
method. This will return a transport
specific object that implements the RMPacketSocket interface. The methods
of this interface can be used to send and receive data or change or monitor
the multicast transport session.
Most transports will want to create a class that implements the RMPacketSocket interface. Simple applications may use the RMStreamSocket interface, but more sophisticated ones will want the more advanced capabilities that the RMPacketSocket interface 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.net.InetAddress |
getInterface()
Returns the address of the network interface used for sending data for this multicast transport session. |
int |
getMaxLength()
Gets the maximum amount of data that can be sent in a DatagramPacket over this socket. |
RMStatistics |
getRMStatistics()
Retrieve the RMStatistics block of this socket. |
TransportProfile |
getTransportProfile()
Retrieve the transport profile this socket is currently using. |
java.net.DatagramPacket |
receive()
Returns the next DatagramPacket available. |
void |
send(java.net.DatagramPacket dp)
Sends a DatagramPacket over the multicast transport session. |
void |
setInterface(java.net.InetAddress ia)
Sets the address of the network interface used for sending data for this multicast transport session. |
Method Detail |
public void send(java.net.DatagramPacket dp) throws java.io.IOException, RMException
dp
- the DatagramPacket to be sent.java.io.IOException
- if an I/O error occursRMException
- if a reliable-multicast-related exception occurspublic java.net.DatagramPacket receive() throws java.io.IOException, SessionDoneException, RMException, IrrecoverableDataException
java.io.IOException
- if an I/O error occursSessionDoneException
- if the session is doneRMException
- 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 a socket-related 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 a socket-related error occursUnsupportedException
- if the transport does not
support setting the interfaceRMException
- if a reliable-multicast-related exception occurspublic int getMaxLength() throws RMException
RMException
- 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.