drcl.comp.lib.bytestream
Class ByteStreamContract
java.lang.Object
drcl.comp.Contract
drcl.comp.lib.bytestream.ByteStreamContract
- All Implemented Interfaces:
- ByteStreamConstants
- public class ByteStreamContract
- extends Contract
- implements ByteStreamConstants
The byte stream sending contract.
In this contract, the initiator sends byte stream data to the reactor.
The reactor has a receiving buffer to hold the data and the data is consumed
by the reactor at the pace depending on the implementation of the reactor.
ByteStreamSending
- The initiator sends a message which consists of:
- an integer of 0 (the "send" command),
- the byte array (
byte[]),
- the offset of the first byte in the byte array to start sending, and
- the length of sending (
int).
The reactor moves the bytes of the specified length (> 0) from the
byte array to its buffer if the buffer in the reactor allows, and
may return an
Integer indicating the available receiving buffer in bytes
in the reactor. A negative value indicates the amount of buffer overflow
if the data is too large to fit in the receiving buffer.
BufferReport
- The reactor sends the available receiving buffer size in bytes in a
message whenever data is consumed and removed from the buffer.
The message consists of:
- an integer of 1 (the "report" command) and
- the available buffer size in bytes (int).
BufferQuery
- The initiator sends a message which consists of an integer of 2
(the "query" command).
In response, the reactor returns the available buffer in bytes
in
Integer.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteStreamContract
public ByteStreamContract()
ByteStreamContract
public ByteStreamContract(int role_)
getName
public java.lang.String getName()
- Specified by:
getName in class Contract
getContractContent
public java.lang.Object getContractContent()
- Description copied from class:
Contract
- Returns the content of this contract (format?).
- Specified by:
getContractContent in class Contract
query
public static int query(Port port_)
Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved. ~ To J-Sim Home ~