| org.jacorb.orb.etf.ConnectionBase org.jacorb.orb.etf.StreamConnectionBase
All known Subclasses: org.jacorb.orb.iiop.IIOPConnection, org.jacorb.orb.iiop.IIOPLoopbackConnection,
StreamConnectionBase | abstract public class StreamConnectionBase extends ConnectionBase (Code) | | This an abstract base implementation of the ETF::Connection interface.
author: Nicolas Noffke author: Andre Spiegel version: $Id: StreamConnectionBase.java,v 1.6 2007/02/06 09:15:22 andre.spiegel Exp $ |
Method Summary | |
public void | flush() Causes any buffered data to be actually written to the Connection. | public boolean | is_data_available() Simply return true if calling a read on this instance would
find data in the connection. | public int | read(org.omg.ETF.BufferHolder data, int offset, int min_length, int max_length, long time_out) Reads bytes from the connection.
Parameters: data - holds a byte array to which the bytes will be written. | public void | write(boolean is_first, boolean is_last, byte[] data, int offset, int length, long time_out) Writes bytes to this Connection.
Parameters: is_first - Currently not used in JacORB. Parameters: is_last - Currently not used in JacORB. Parameters: data - the buffer that holds the data that is to be written. Parameters: offset - index of the first byte in data that shallbe written to the Connection. Parameters: length - the number of bytes in data that shall be written. |
StreamConnectionBase | protected StreamConnectionBase()(Code) | | |
StreamConnectionBase | protected StreamConnectionBase(StreamConnectionBase other)(Code) | | Initialise this instance as a copy of another. Intended for use within subclass
constructors.
|
flush | public void flush()(Code) | | Causes any buffered data to be actually written to the Connection.
|
is_data_available | public boolean is_data_available()(Code) | | Simply return true if calling a read on this instance would
find data in the connection. Otherwise, the function shall
return false.
|
read | public int read(org.omg.ETF.BufferHolder data, int offset, int min_length, int max_length, long time_out)(Code) | | Reads bytes from the connection.
Parameters: data - holds a byte array to which the bytes will be written. Thefield data.value must be initialized with a valid bytearray already, it cannot be null. Parameters: offset - the index in data.value at which the firstbyte will be written. Parameters: min_length - the minimum number of bytes that shall be read fromthe Connection. The method will block until at least this many byteshave been read. If min_length is 0, the method will alwaysreturn immediately without reading any data. Parameters: max_length - the maximum number of bytes that shall be read fromthe Connection. If max_length is greater thanmin_length , then the transport is free to read(max_length - min_length ) additional bytesbeyond min_length . Parameters: time_out - timeout for this particular read operation. Currentlyignored in JacORB; we use socket-level timeouts. the number of bytes actually read. The last byte written todata.value is at the index offset + this returnvalue. This return type is a change to the ETF draft spec in JacORB.It is needed because the mechanism suggested in the draft does not workin Java. exception: org.omg.CORBA.TIMEOUT - if the socket-level timeout expiresbefore the read operation completes. exception: org.omg.CORBA.TRANSIENT - if the I/O is interrupted. exception: org.omg.CORBA.COMM_FAILURE - if the read operation fails,for example because the connection has been closed. |
write | public void write(boolean is_first, boolean is_last, byte[] data, int offset, int length, long time_out)(Code) | | Writes bytes to this Connection.
Parameters: is_first - Currently not used in JacORB. Parameters: is_last - Currently not used in JacORB. Parameters: data - the buffer that holds the data that is to be written. Parameters: offset - index of the first byte in data that shallbe written to the Connection. Parameters: length - the number of bytes in data that shall be written. The last byte in data that is written is at the indexoffset + length . Parameters: time_out - timeout for this particular write operation. Currentlyignored in JacORB. exception: org.omg.CORBA.COMM_FAILURE - if anything goes wrong duringthe write operation. |
|
|