V
V
Vitaly Yakovenko2012-10-18 17:55:16
Java
Vitaly Yakovenko, 2012-10-18 17:55:16

Java NIO: Is it possible to "unregister" a SocketChannel from a Selector?

Looking for an "antonym" for SocketChannel.register(selector, SelectionKeys);
Logical question: why should I?
Answer: I want to have multiple selectors in my application. According to the first selector, the server responds to each requesting client with service information. This selector can also be used by the client to combine it with several other clients into a "room" (rooms are processed in separate threads). At the same time, he no longer needs service information, there is no point in pulling the first selector.
Actually, is it possible to do this, what will help me?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gvsmirnov, 2012-10-19
@Xazzzi

docs.oracle.com/javase/7/docs/api/java/nio/channels/spi/AbstractSelector.html#deregister (java.nio.channels.spi.AbstractSelectionKey) - isn't it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question