Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@markfisher markfisher authored
View
10 ...java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java
@@ -20,6 +20,7 @@
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.nio.ByteBuffer;
+import java.nio.channels.CancelledKeyException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
@@ -123,7 +124,14 @@ public void run() {
while (this.isActive()) {
SocketChannel newChannel;
int soTimeout = this.getSoTimeout();
- int selectionCount = selector.select(soTimeout < 0 ? 0 : soTimeout);
+ int selectionCount = 0;
+ try {
+ selectionCount = selector.select(soTimeout < 0 ? 0 : soTimeout);
+ } catch (CancelledKeyException cke) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("CancelledKeyException during Selector.select()");
+ }
+ }
while ((newChannel = newChannels.poll()) != null) {
try {
newChannel.register(this.selector, SelectionKey.OP_READ, connections.get(newChannel));
Please sign in to comment.
Something went wrong with that request. Please try again.