| java.lang.Object org.apache.tomcat.util.net.NioBlockingSelector
NioBlockingSelector | public class NioBlockingSelector (Code) | | |
Method Summary | |
public static int | read(ByteBuffer buf, NioChannel socket, long readTimeout) Performs a blocking read using the bytebuffer for data to be read
If the selector parameter is null, then it will perform a busy read that could
take up a lot of CPU cycles. | public static int | write(ByteBuffer buf, NioChannel socket, long writeTimeout) Performs a blocking write using the bytebuffer for data to be written
If the selector parameter is null, then it will perform a busy write that could
take up a lot of CPU cycles. |
NioBlockingSelector | public NioBlockingSelector()(Code) | | |
read | public static int read(ByteBuffer buf, NioChannel socket, long readTimeout) throws IOException(Code) | | Performs a blocking read using the bytebuffer for data to be read
If the selector parameter is null, then it will perform a busy read that could
take up a lot of CPU cycles.
Parameters: buf - ByteBuffer - the buffer containing the data, we will read as until we have read at least one byte or we timed out Parameters: socket - SocketChannel - the socket to write data to Parameters: selector - Selector - the selector to use for blocking, if null then a busy read will be initiated Parameters: readTimeout - long - the timeout for this read operation in milliseconds, -1 means no timeout int - returns the number of bytes read throws: EOFException - if read returns -1 throws: SocketTimeoutException - if the read times out throws: IOException - if an IO Exception occurs in the underlying socket logic |
write | public static int write(ByteBuffer buf, NioChannel socket, long writeTimeout) throws IOException(Code) | | Performs a blocking write using the bytebuffer for data to be written
If the selector parameter is null, then it will perform a busy write that could
take up a lot of CPU cycles.
Parameters: buf - ByteBuffer - the buffer containing the data, we will write as long as (buf.hasRemaining()==true) Parameters: socket - SocketChannel - the socket to write data to Parameters: writeTimeout - long - the timeout for this write operation in milliseconds, -1 means no timeout int - returns the number of bytes written throws: EOFException - if write returns -1 throws: SocketTimeoutException - if the write times out throws: IOException - if an IO Exception occurs in the underlying socket logic |
|
|