rtpi.transport
Interface Transport

All Known Implementing Classes:
IPMCTransport

public abstract interface Transport

This is the interface which needs to be implemented by a transport layer implementation. By implementing Transport, the transport layer can be used with the rtp and rtpi libraries.

Author:
Martin Mauve

Method Summary
 int getHeaderSize()
          Get the header size for this transport (network+transport header!)
 int getTransportPayloadSize()
          Returns the maximum payload size which can be transported without fragmentation by the transport implementation.
 void joinGroup()
          Join the transport session.
 void leaveGroup()
          Leave the transport session.
 void queryNetworkResources(int senderFree, int receiverFree, NotificationRecipient recipient)
          This requests that a NotificationRecipient is informed when the network becomes idle.
 void quit()
          This terminates the transport service
 void registerTransportRecipient(TransportRecipient transRec)
          Register a recipient for the packets received by this tranport instance.
 void sendTransportPacket(TransportPacket packet)
          Sends a TransportPacket.
 

Method Detail

quit

public void quit()
This terminates the transport service

registerTransportRecipient

public void registerTransportRecipient(TransportRecipient transRec)
Register a recipient for the packets received by this tranport instance. Transport packets are handed only to the last TransportRecipient instance for which this method is called.
Parameters:
transRec - The transport recipient which should receive incoming transport packets.

joinGroup

public void joinGroup()
               throws java.io.IOException
Join the transport session. For multicast transport implementations this is call joins the multicast group. Unicast implementations should make sure that no packets are handed to the TransportRecipien before this method is called.

leaveGroup

public void leaveGroup()
Leave the transport session. For multicast transport implementations this call leaves the multicast group. Unicast implementations should make sure that no packets are handed to the TransportRecipient after this method is called.

sendTransportPacket

public void sendTransportPacket(TransportPacket packet)
Sends a TransportPacket.
Parameters:
packet - The packet to be sent.

getHeaderSize

public int getHeaderSize()
Get the header size for this transport (network+transport header!)
Returns:
The header size.

getTransportPayloadSize

public int getTransportPayloadSize()
Returns the maximum payload size which can be transported without fragmentation by the transport implementation.
Returns:
the maximum payload size

queryNetworkResources

public void queryNetworkResources(int senderFree,
                                  int receiverFree,
                                  NotificationRecipient recipient)
This requests that a NotificationRecipient is informed when the network becomes idle.
Parameters:
sendFree - The boundary of the send data rate (bit/s) below which the network is considered idle.
receivFree - The boundary of of the received data rate (bit/s) below which the network is considered idle. This includes the data send. Therefore: receivedFree=sendFree+x
recipient - The notificationRecipient that is interested in receiving a notification when the network becomes idle.