Revision: 4868 http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4868&view=rev Author: bphinz Date: 2012-03-15 02:57:52 +0000 (Thu, 15 Mar 2012) Log Message: ----------- Fix an issue where java viewer appears to hang on Mac OS X. As far as I can tell, this is caused by an upstream bug which might be fixed in JDK 7, but for now this gets around the problem without significantly affecting performance.
Modified Paths: -------------- trunk/java/com/tigervnc/network/SocketDescriptor.java Modified: trunk/java/com/tigervnc/network/SocketDescriptor.java =================================================================== --- trunk/java/com/tigervnc/network/SocketDescriptor.java 2012-03-14 04:15:17 UTC (rev 4867) +++ trunk/java/com/tigervnc/network/SocketDescriptor.java 2012-03-15 02:57:52 UTC (rev 4868) @@ -34,7 +34,7 @@ implements FileDescriptor { public SocketDescriptor() throws Exception { - super(SelectorProvider.provider()); + super(DefaultSelectorProvider()); try { channel = SocketChannel.open(); channel.configureBlocking(false); @@ -49,6 +49,14 @@ } } + private static SelectorProvider DefaultSelectorProvider() { + // kqueue() selector provider on OS X is not working, fall back to select() for now + String os = System.getProperty("os.name"); + if (os.startsWith("Mac OS X")) + System.setProperty("java.nio.channels.spi.SelectorProvider","sun.nio.ch.PollSelectorProvider"); + return SelectorProvider.provider(); + } + synchronized public int read(byte[] buf, int bufPtr, int length) throws Exception { int n; ByteBuffer b = ByteBuffer.allocate(length); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Tigervnc-commits mailing list Tigervnc-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tigervnc-commits