src/share/classes/java/net/SocketOutputStream.java

Print this page
rev 6052 : [mq]: jdk.patch

@@ -28,10 +28,12 @@
 import java.io.FileDescriptor;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.nio.channels.FileChannel;
 
+import sun.misc.IoTrace;
+
 /**
  * This stream extends FileOutputStream to implement a
  * SocketOutputStream. Note that this class should <b>NOT</b> be
  * public.
  *

@@ -102,10 +104,11 @@
                 return;
             }
             throw new ArrayIndexOutOfBoundsException();
         }
 
+        Object traceHandle = IoTrace.socketWriteBegin(impl.address, impl.port);
         FileDescriptor fd = impl.acquireFD();
         try {
             socketWrite0(fd, b, off, len);
         } catch (SocketException se) {
             if (se instanceof sun.net.ConnectionResetException) {

@@ -117,10 +120,11 @@
             } else {
                 throw se;
             }
         } finally {
             impl.releaseFD();
+            IoTrace.socketWriteEnd(traceHandle, len);
         }
     }
 
     /**
      * Writes a byte to the socket.