Merge pull request #2 from normanmaurer/io_uring_break
Add missing break statement and cleanup
This commit is contained in:
commit
3cdb1d60ae
@ -52,7 +52,7 @@ abstract class AbstractIOUringServerChannel extends AbstractIOUringChannel imple
|
||||
|
||||
abstract Channel newChildChannel(int fd) throws Exception;
|
||||
|
||||
void acceptComplete(int res) {
|
||||
boolean acceptComplete(int res) {
|
||||
if (res >= 0) {
|
||||
final IOUringRecvByteAllocatorHandle allocHandle =
|
||||
(IOUringRecvByteAllocatorHandle) unsafe()
|
||||
@ -71,6 +71,7 @@ abstract class AbstractIOUringServerChannel extends AbstractIOUringChannel imple
|
||||
}
|
||||
//Todo refactoring method name
|
||||
executeReadEvent();
|
||||
return res >= 0;
|
||||
}
|
||||
|
||||
final class UringServerChannelUnsafe extends AbstractIOUringChannel.AbstractUringUnsafe {
|
||||
|
@ -44,8 +44,6 @@ final class IOUringEventLoop extends SingleThreadEventLoop implements
|
||||
private static final long ETIME = -62;
|
||||
static final long ECANCELED = -125;
|
||||
|
||||
// events should be unique to identify which event type that was
|
||||
private long eventIdCounter;
|
||||
private final IntObjectMap<AbstractIOUringChannel> channels = new IntObjectHashMap<AbstractIOUringChannel>(4096);
|
||||
private final RingBuffer ringBuffer;
|
||||
|
||||
@ -191,8 +189,11 @@ final class IOUringEventLoop extends SingleThreadEventLoop implements
|
||||
if (res != -1 && res != ERRNO_EAGAIN_NEGATIVE &&
|
||||
res != ERRNO_EWOULDBLOCK_NEGATIVE) {
|
||||
logger.trace("server filedescriptor Fd: {}", fd);
|
||||
acceptChannel.acceptComplete(res);
|
||||
pollRdHup(res);
|
||||
if (acceptChannel.acceptComplete(res)) {
|
||||
// all childChannels should poll POLLRDHUP
|
||||
submissionQueue.addPollRdHup(res);
|
||||
submissionQueue.submit();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IOUring.OP_READ:
|
||||
@ -247,9 +248,9 @@ final class IOUringEventLoop extends SingleThreadEventLoop implements
|
||||
} else {
|
||||
//Todo error handling error
|
||||
logger.trace("POLL_LINK Res: {}", res);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IOUring.OP_POLL_REMOVE:
|
||||
if (res == ENOENT) {
|
||||
logger.trace("POLL_REMOVE OPERATION not permitted");
|
||||
@ -282,11 +283,4 @@ final class IOUringEventLoop extends SingleThreadEventLoop implements
|
||||
Native.eventFdWrite(eventfd.intValue(), 1L);
|
||||
}
|
||||
}
|
||||
|
||||
//to be notified when the filedesciptor is closed
|
||||
private void pollRdHup(int fd) {
|
||||
//all childChannels should poll POLLRDHUP
|
||||
ringBuffer.getIoUringSubmissionQueue().addPollRdHup(fd);
|
||||
ringBuffer.getIoUringSubmissionQueue().submit();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user