0
server.register(selector, SelectionKey.OP_CONNECT);
server.connect(address);

Any idea why when I inspect selector in WindowsSelectorImpl I see totalChannels = 2 even though I register only one channel?

traveh
  • 2,700
  • 3
  • 27
  • 44
  • I am debugging some code where I am using `select()` but I'm not checking which channel is returned in the selectedKeys. The selector returns but the channel doesn't seem to be in the state I was expecting. I was wondering if there is some "secret" channel that comes along with the selector implementation that makes it impossible to rely on the fact that I only registered 1 channel. – traveh Jun 11 '15 at 10:02
  • There can be a secret channel when you have > 63 of them registered, but you're barking up the wrong tree here. If the channel isn't in the state you expect you should publish the code that makes you think so. – user207421 Jun 11 '15 at 10:18
  • I see. Yes, I will do that if I don't manage to figure out the problem. For now I was just wondering why it seems like (internally) there are 2 channels registered. – traveh Jun 11 '15 at 10:20

0 Answers0