< prev index next >

src/jdk.net/linux/classes/jdk/internal/net/rdma/RdmaServerSocketChannelImpl.java

Print this page

        

*** 78,97 **** private boolean isReuseAddress; private ServerSocket socket; RdmaServerSocketChannelImpl(SelectorProvider sp) throws IOException { ! super(sp); this.fd = RdmaNet.serverSocket(); this.fdVal = IOUtil.fdVal(fd); } RdmaServerSocketChannelImpl(SelectorProvider sp, FileDescriptor fd, boolean bound) throws IOException { ! super(sp); this.fd = fd; this.fdVal = IOUtil.fdVal(fd); if (bound) { synchronized (stateLock) { localAddress = RdmaNet.localAddress(fd); --- 78,106 ---- private boolean isReuseAddress; private ServerSocket socket; + private static final UnsupportedOperationException unsupported; + + private static final SelectorProvider checkSupported(SelectorProvider sp) { + if (unsupported != null) + throw new UnsupportedOperationException(unsupported.getMessage(), unsupported); + else + return sp; + } + RdmaServerSocketChannelImpl(SelectorProvider sp) throws IOException { ! super(checkSupported(sp)); this.fd = RdmaNet.serverSocket(); this.fdVal = IOUtil.fdVal(fd); } RdmaServerSocketChannelImpl(SelectorProvider sp, FileDescriptor fd, boolean bound) throws IOException { ! super(checkSupported(sp)); this.fd = fd; this.fdVal = IOUtil.fdVal(fd); if (bound) { synchronized (stateLock) { localAddress = RdmaNet.localAddress(fd);
*** 467,480 **** private native int accept0(FileDescriptor ssfd, FileDescriptor newfd, InetSocketAddress[] isaa) throws IOException; ! private static native void initIDs(); static { IOUtil.load(); System.loadLibrary("extnet"); initIDs(); nd = new RdmaSocketDispatcher(); } } --- 476,495 ---- private native int accept0(FileDescriptor ssfd, FileDescriptor newfd, InetSocketAddress[] isaa) throws IOException; ! private static native void initIDs()throws UnsupportedOperationException; static { IOUtil.load(); System.loadLibrary("extnet"); + UnsupportedOperationException uoe = null; + try { initIDs(); + } catch (UnsupportedOperationException e) { + uoe = e; + } + unsupported = uoe; nd = new RdmaSocketDispatcher(); } }
< prev index next >