return false;
}//end if
} else if ( key.isWritable() ) {
- boolean writecomplete = write(key);
+ boolean writecomplete = write();
if ( writecomplete ) {
//we are completed, should we read an ack?
if ( waitForAck ) {
//if not, we are ready, setMessage will reregister us for another write interest
//do a health check, we have no way of verify a disconnected
//socket since we don't register for OP_READ on waitForAck=false
- read(key);//this causes overhead
+ read();//this causes overhead
setRequestCount(getRequestCount()+1);
return true;
}
key.interestOps(key.interestOps()|SelectionKey.OP_WRITE);
}//end if
} else if ( key.isReadable() ) {
- boolean readcomplete = read(key);
+ boolean readcomplete = read();
if ( readcomplete ) {
setRequestCount(getRequestCount()+1);
return true;
- protected boolean read(SelectionKey key) throws IOException {
+ protected boolean read() throws IOException {
//if there is no message here, we are done
if ( current == null ) return true;
int read = isUdpBased()?dataChannel.read(readbuf) : socketChannel.read(readbuf);
}
- protected boolean write(SelectionKey key) throws IOException {
+ protected boolean write() throws IOException {
if ( (!isConnected()) || (this.socketChannel==null && this.dataChannel==null)) {
throw new IOException("NioSender is not connected, this should not occur.");
}