Class IORequest
- java.lang.Object
-
- edu.rit.mp.IORequest
-
public class IORequest extends java.lang.ObjectClass IORequest encapsulates the state of a message being sent or received in the Message Protocol (MP).Class ChannelGroup's non-blocking sendNoWait() method includes an IORequest argument. This allows the caller to initiate the send operation and continue processing while the channel group sends the message in a separate thread. To wait for the message to be sent, the caller must call the IORequest object's waitForFinish() method.
Class ChannelGroup's non-blocking receiveNoWait() method includes an IORequest argument. This allows the caller to initiate the receive operation and continue processing while the channel group receives the message in a separate thread. To wait for the message to be received, the caller must call the IORequest object's waitForFinish() method, which returns a Status object giving the results of the receive operation.
-
-
Constructor Summary
Constructors Constructor and Description IORequest()Construct a new I/O request object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanisFinished()Determine if this I/O request has finished.java.lang.StringtoString()Returns a string version of this I/O request.StatuswaitForFinish()Wait until the send or receive operation corresponding to this I/O request has finished.
-
-
-
Method Detail
-
isFinished
public boolean isFinished() throws java.io.IOExceptionDetermine if this I/O request has finished.- Returns:
- False if this I/O request has not finished, true if this I/O request has finished successfully.
- Throws:
java.io.IOException- Thrown if this I/O request has finished and an I/O error occurred.
-
waitForFinish
public Status waitForFinish() throws java.io.IOException
Wait until the send or receive operation corresponding to this I/O request has finished. For a receive operation, a Status object containing the results of the receive operation is returned; for a send operation, null is returned.- Returns:
- Receive status for a receive operation, or null for a send operation.
- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
toString
public java.lang.String toString()
Returns a string version of this I/O request.- Overrides:
toStringin classjava.lang.Object- Returns:
- String version.
-
-
DMelt 3.0 © DataMelt by jWork.ORG