|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.multicast.reliable.transport.tram.TRAMPacketSocket
The TRAMPacketSocket implements RMPacketSocket Interface. TRAMPacketSocket allows applications to send and receive packets, set the interface over which data is to be sent, and close the socket after completion or to abort the connection before the session ends.
Constructor Summary | |
TRAMPacketSocket()
|
|
TRAMPacketSocket(TRAMSimulator simulator)
|
Method Summary | |
void |
abort()
Abort the current connection. |
void |
close()
The close method shuts down the socket after flushing the transmit queue. |
java.net.InetAddress |
getInterface()
The getInterface method returns the InetAddress of the local port that data is transmitted on if other than the default. |
int |
getMaxLength()
Gets the maximum amount of data that can be sent in a DatagramPacket over this socket. |
long |
getReceiverMaxDataRate()
Gets the Max receiver rate at the transport profile associated with this socket. |
RMStatistics |
getRMStatistics()
This method returns a clone of the Statistics block in use in this socket. |
TransportProfile |
getTransportProfile()
This method returns a clone of the TransportProfile in use in this socket. |
void |
monitor()
Lets the application monitor the session without receiving packets. |
java.net.DatagramPacket |
receive()
The receive method returns the next RMDatagramPacket. |
void |
send(java.net.DatagramPacket dp)
The send method transmits the DatagramPacket over the multicast connection. |
int |
send(java.net.DatagramPacket dp,
int fb)
This send method transmits the DatagramPacket over the multicast connection. |
void |
setInterface(java.net.InetAddress ia)
Set the interface which data will be transmitted on. |
void |
setReceiverMaxDataRate(long rate)
Sets the Max receiver rate at the transport profile associated with this socket. |
void |
simulateMulticastPacketReceive(java.net.DatagramPacket dp)
Injects the multicast packet into the input dispatcher |
void |
simulateUnicastPacketReceive(java.net.DatagramPacket dp)
Injects the unicast packet into the input dispatcher |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TRAMPacketSocket()
public TRAMPacketSocket(TRAMSimulator simulator)
Method Detail |
public java.net.InetAddress getInterface() throws java.net.SocketException
getInterface
in interface RMPacketSocket
com.sun.multicast.reliable.transport.RMPacketSocket
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
setInterface
in interface RMPacketSocket
ia
- the InetAddress of the interface to transmit data on.public void send(java.net.DatagramPacket dp) throws java.io.IOException
send
in interface RMPacketSocket
dp
- the DatagramPacket to be sent.java.io.IOException
- is raised if an error occurs sending the data.
We need to add the TRAM header on top of the passed in packet... hence
we need to create another datagram packet large enough to hold the
TRAM header plus the passed in data and then hand it over to the lower
layer to transmit it.public int send(java.net.DatagramPacket dp, int fb) throws java.io.IOException
dp
- the DatagramPacket to be sent.fb
- the forgetBeforeSeqNum to be included in packet.java.io.IOException
- is raised if an error occurs sending the data.
We need to add the TRAM header on top of the passed in packet... hence
we need to create another datagram packet large enough to hold the
TRAM header plus the passed in data and then hand it over to the lower
layer to transmit it.public java.net.DatagramPacket receive() throws java.io.IOException, SessionDoneException, IrrecoverableDataException, SessionDownException, MemberPrunedException
receive
in interface RMPacketSocket
java.io.IOException
- is thrown if an error occurs retrieving the
data.SessionDoneException
- if the end of the data
stream is detected.IrrecoverableDataException
- when a packet is lost
in transmission and cannot be recovered.SessionDownException
- when the sender has left the
multicast group.public void monitor() throws java.io.IOException, SessionDoneException, IrrecoverableDataException, SessionDownException
public void abort()
abort
in interface RMPacketSocket
public void close()
close
in interface RMPacketSocket
public int getMaxLength()
getMaxLength
in interface RMPacketSocket
public TransportProfile getTransportProfile()
getTransportProfile
in interface RMPacketSocket
public RMStatistics getRMStatistics()
getRMStatistics
in interface RMPacketSocket
public void simulateMulticastPacketReceive(java.net.DatagramPacket dp)
packet
- the multicast datagram packetpublic void simulateUnicastPacketReceive(java.net.DatagramPacket dp)
packet
- the unicast datagram packetpublic void setReceiverMaxDataRate(long rate)
long
- max receiver data ratepublic long getReceiverMaxDataRate()
|
|||||||||
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.