wsky / top-link

embedded duplex multi-channel endpoint and connection management for c#/java/...
6 stars 1 forks source link

how to process write event only, hold read event from nio selector #67

Closed wsky closed 11 years ago

wsky commented 11 years ago

sometimes, we need flush data right now but not read incoming data from socket.

Is there anyway to raise select.write only?

wsky commented 11 years ago

if processing message in netty io-thread, write will be hold util user code finished

https://github.com/netty/netty/blob/netty-3.5.7.Final/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java#L98

protected boolean scheduleWriteIfNecessary(final AbstractNioChannel<?> channel) {
        final Thread currentThread = Thread.currentThread();
        final Thread workerThread = thread;
        if (currentThread != workerThread) {
//....
}
wsky commented 11 years ago

unnecessary, just control by user worker pool