src/share/classes/java/net/SocketOutputStream.java
Print this page
rev 5501 : imported patch io-trace
*** 28,37 ****
--- 28,39 ----
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,114 ****
--- 104,119 ----
return;
}
throw new ArrayIndexOutOfBoundsException();
}
+ Object traceContext = IoTrace.socketWriteBegin(impl.address, impl.port);
+ int bytesWritten = 0;
FileDescriptor fd = impl.acquireFD();
try {
socketWrite0(fd, b, off, len);
+ bytesWritten = len;
} catch (SocketException se) {
if (se instanceof sun.net.ConnectionResetException) {
impl.setConnectionResetPending();
se = new SocketException("Connection reset");
}
*** 117,126 ****
--- 122,132 ----
} else {
throw se;
}
} finally {
impl.releaseFD();
+ IoTrace.socketWriteEnd(traceContext, bytesWritten);
}
}
/**
* Writes a byte to the socket.