jist.swans.trans
Interface TransInterface

All Superinterfaces:
JistAPI.Proxiable, JistAPI.Timeless, NetInterface.NetHandler
All Known Subinterfaces:
TransInterface.TransTcpInterface, TransInterface.TransUdpInterface
All Known Implementing Classes:
TransTcp, TransUdp

public interface TransInterface
extends JistAPI.Proxiable, NetInterface.NetHandler

Defines the interface of all Transport layer entity implementations.

Since:
SWANS1.0
Version:
$Id: TransInterface.java,v 1.22 2004/04/06 16:07:51 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Nested Class Summary
static interface TransInterface.SocketHandler
          Socket callback handler.
static class TransInterface.TransMessage
          Super-class of all transport layer packets.
static interface TransInterface.TransTcpInterface
          Defines the Transport sub-interface for TCP entities.
static interface TransInterface.TransUdpInterface
          Defines the Transport sub-interface for UDP entities.
 
Method Summary
 void addSocketHandler(int port, TransInterface.SocketHandler socketCallback)
          Register socket handler.
 void delSocketHandler(int port)
          Unregister socket handler.
 void send(Message msg, NetAddress dst, int dstPort, int srcPort, byte priority)
          Send message (from APPLICATON).
 
Methods inherited from interface jist.swans.net.NetInterface.NetHandler
receive
 

Method Detail

send

void send(Message msg,
          NetAddress dst,
          int dstPort,
          int srcPort,
          byte priority)
Send message (from APPLICATON).

Parameters:
msg - packet payload (usually from application layer)
dst - packet destination address
dstPort - packet destination port
srcPort - packet source port
priority - packet priority

addSocketHandler

void addSocketHandler(int port,
                      TransInterface.SocketHandler socketCallback)
                      throws JistAPI.Continuation
Register socket handler.

Parameters:
port - bound socket port
socketCallback - callback handler
Throws:
JistAPI.Continuation - never; blocking event

delSocketHandler

void delSocketHandler(int port)
                      throws JistAPI.Continuation
Unregister socket handler.

Parameters:
port - bound socket port
Throws:
JistAPI.Continuation - never; blocking event