--- a/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java Wed Jul 21 13:52:38 2010 +0100
+++ b/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java Wed Jul 21 18:08:46 2010 +0100
@@ -498,6 +498,36 @@
return write0(Util.subsequence(srcs, offset, length));
}
+ // package-private
+ int sendOutOfBandData(byte b) throws IOException {
+ synchronized (writeLock) {
+ ensureWriteOpen();
+ int n = 0;
+ try {
+ begin();
+ synchronized (stateLock) {
+ if (!isOpen())
+ return 0;
+ writerThread = NativeThread.current();
+ }
+ for (;;) {
+ n = sendOutOfBandData(fd, b);
+ if ((n == IOStatus.INTERRUPTED) && isOpen())
+ continue;
+ return IOStatus.normalize(n);
+ }
+ } finally {
+ writerCleanup();
+ end((n > 0) || (n == IOStatus.UNAVAILABLE));
+ synchronized (stateLock) {
+ if ((n <= 0) && (!isOutputOpen))
+ throw new AsynchronousCloseException();
+ }
+ assert IOStatus.check(n);
+ }
+ }
+ }
+
protected void implConfigureBlocking(boolean block) throws IOException {
IOUtil.configureBlocking(fd, block);
}
@@ -957,6 +987,9 @@
boolean block, boolean ready)
throws IOException;
+ private static native int sendOutOfBandData(FileDescriptor fd, byte data)
+ throws IOException;
+
static {
Util.load();
nd = new SocketDispatcher();