Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #276 from garyrussell/INT-2333

  INT-2333 Work Around for MAC OSX JVM Bug
  • Loading branch information...
commit 1a7dae5f270ec8050c0a5e41dc1a7b3bde6684d1 2 parents bc09b06 + 49c5235
Mark Fisher markfisher authored
10 ...on-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java
@@ -20,6 +20,7 @@
20 20 import java.net.InetSocketAddress;
21 21 import java.net.SocketException;
22 22 import java.nio.ByteBuffer;
  23 +import java.nio.channels.CancelledKeyException;
23 24 import java.nio.channels.ClosedChannelException;
24 25 import java.nio.channels.SelectionKey;
25 26 import java.nio.channels.Selector;
@@ -123,7 +124,14 @@ public void run() {
123 124 while (this.isActive()) {
124 125 SocketChannel newChannel;
125 126 int soTimeout = this.getSoTimeout();
126   - int selectionCount = selector.select(soTimeout < 0 ? 0 : soTimeout);
  127 + int selectionCount = 0;
  128 + try {
  129 + selectionCount = selector.select(soTimeout < 0 ? 0 : soTimeout);
  130 + } catch (CancelledKeyException cke) {
  131 + if (logger.isDebugEnabled()) {
  132 + logger.debug("CancelledKeyException during Selector.select()");
  133 + }
  134 + }
127 135 while ((newChannel = newChannels.poll()) != null) {
128 136 try {
129 137 newChannel.register(this.selector, SelectionKey.OP_READ, connections.get(newChannel));

0 comments on commit 1a7dae5

Please sign in to comment.
Something went wrong with that request. Please try again.