com.sun.multicast.reliable.transport.tram
Class TRAMStreamSocket

java.lang.Object
  |
  +--com.sun.multicast.reliable.transport.tram.TRAMStreamSocket
All Implemented Interfaces:
RMStreamSocket

public class TRAMStreamSocket
extends java.lang.Object
implements RMStreamSocket

The TRAMStreamSocket implements RMStreamSocket Interface. TRAMStreamSocket allows applications to send and receive data, 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
TRAMStreamSocket()
          The TRAMStreamSocket Constructor.
 
Method Summary
 void abort()
          Abort the current connection.
 void close()
          The close method shuts down the socket after flushing the transmit queue.
 java.io.InputStream getInputStream()
          The getInputStream method returns an InputStream object for this transport.
 java.net.InetAddress getInterface()
          The getInterface method returns the InetAddress of the local port that data is transmitted on if other than the default.
 java.io.OutputStream getOutputStream()
          The getOutputStream method returns an OutputStream object for sending data over the multicast connection.
 RMStatistics getRMStatistics()
          This method returns a clone(copy) of the Statistics block in use in this socket.
 TransportProfile getTransportProfile()
          This method returns a clone(copy) of the TransportProfile in use in this socket.
 void setInterface(java.net.InetAddress ia)
          Sets the interface on which the data will be transmitted on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TRAMStreamSocket

public TRAMStreamSocket()
The TRAMStreamSocket Constructor.
Method Detail

getInterface

public java.net.InetAddress getInterface()
                                  throws java.net.SocketException
The getInterface method returns the InetAddress of the local port that data is transmitted on if other than the default.
Specified by:
getInterface in interface RMStreamSocket
Following copied from interface: com.sun.multicast.reliable.transport.RMStreamSocket
Returns:
the address of the network interface for outgoing data.
Throws:
java.net.SocketException - if an error occurs
UnsupportedException - if the transport does not support getting the interface
RMException - if a reliable-multicast-related exception occurs

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
The getInputStream method returns an InputStream object for this transport. The transport must implement the input stream and provide the application with the read functions for obtaining incoming data.
Specified by:
getInputStream in interface RMStreamSocket
Following copied from interface: com.sun.multicast.reliable.transport.RMStreamSocket
Throws:
UnsupportedException - if the transport does not support getting the interface
RMException - if a reliable-multicast-related exception occurs

getOutputStream

public java.io.OutputStream getOutputStream()
The getOutputStream method returns an OutputStream object for sending data over the multicast connection.
Specified by:
getOutputStream in interface RMStreamSocket
Following copied from interface: com.sun.multicast.reliable.transport.RMStreamSocket
Returns:
an OutputStream object.
Throws:
UnsupportedException - if the transport does not support getting the interface
RMException - if a reliable-multicast-related exception occurs

setInterface

public void setInterface(java.net.InetAddress ia)
                  throws java.net.SocketException
Sets the interface on which the data will be transmitted on. This is useful on systems with multiple network interfaces.
Specified by:
setInterface in interface RMStreamSocket
Parameters:
ia - the InetAddress of the interface to transmit data on.

getTransportProfile

public TransportProfile getTransportProfile()
This method returns a clone(copy) of the TransportProfile in use in this socket.
Specified by:
getTransportProfile in interface RMStreamSocket
Returns:
a cloned TransportProfile

getRMStatistics

public RMStatistics getRMStatistics()
This method returns a clone(copy) of the Statistics block in use in this socket.
Specified by:
getRMStatistics in interface RMStreamSocket
Returns:
a cloned TRAM statistics block

abort

public void abort()
Abort the current connection. Any data still waiting to be transmitted is dropped. The connection is shutdown and this socket is closed.
Specified by:
abort in interface RMStreamSocket

close

public void close()
The close method shuts down the socket after flushing the transmit queue. All data previously transmitted will be handed to the network prior to tearing down the connection.
Specified by:
close in interface RMStreamSocket


JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.