[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/socket ...
Ron Sigal
ron_sigal at yahoo.com
Fri Feb 2 21:10:08 EST 2007
User: rsigal
Date: 07/02/02 21:10:08
Modified: src/main/org/jboss/remoting/transport/socket Tag:
remoting_2_x SocketWrapper.java ServerThread.java
Log:
JBREM-690: Moved stream close code from ServerThread to SocketWrapper.
Revision Changes Path
No revision
No revision
1.8.10.6 +14 -2 JBossRemoting/src/main/org/jboss/remoting/transport/socket/SocketWrapper.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SocketWrapper.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/socket/SocketWrapper.java,v
retrieving revision 1.8.10.5
retrieving revision 1.8.10.6
diff -u -b -r1.8.10.5 -r1.8.10.6
--- SocketWrapper.java 31 Jan 2007 11:10:23 -0000 1.8.10.5
+++ SocketWrapper.java 3 Feb 2007 02:10:08 -0000 1.8.10.6
@@ -41,9 +41,10 @@
public static final String MARSHALLER = "marshaller";
public static final String UNMARSHALLER = "unmarshaller";
-
public static final String TEMP_TIMEOUT = "temptimeout";
+ protected static final int CLOSING = 3;
+
// Static ---------------------------------------------------------------------------------------
private static boolean trace = log.isTraceEnabled();
@@ -92,6 +93,17 @@
public void close() throws IOException
{
+ InputStream in = getInputStream();
+ if (in != null)
+ {
+ in.close();
+ }
+ OutputStream out = getOutputStream();
+ if (out != null)
+ {
+ out.close();
+ }
+
if(socket != null)
{
log.debug(this + " closing");
1.29.2.16 +22 -21 JBossRemoting/src/main/org/jboss/remoting/transport/socket/ServerThread.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServerThread.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/socket/ServerThread.java,v
retrieving revision 1.29.2.15
retrieving revision 1.29.2.16
diff -u -b -r1.29.2.15 -r1.29.2.16
--- ServerThread.java 1 Feb 2007 20:23:08 -0000 1.29.2.15
+++ ServerThread.java 3 Feb 2007 02:10:08 -0000 1.29.2.16
@@ -64,7 +64,7 @@
* @author <a href="mailto:tom at jboss.org">Tom Elrod</a>
* @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
*
- * @version $Revision: 1.29.2.15 $
+ * @version $Revision: 1.29.2.16 $
*/
public class ServerThread extends Thread
{
@@ -446,26 +446,27 @@
}
// Ok, we've been shutdown. Do appropriate cleanups.
- try
- {
- if (socketWrapper != null)
- {
- InputStream in = socketWrapper.getInputStream();
- if (in != null)
- {
- in.close();
- }
- OutputStream out = socketWrapper.getOutputStream();
- if (out != null)
- {
- out.close();
- }
- }
- }
- catch (Exception ex)
- {
- log.debug("failed to close in/out", ex);
- }
+ // The stream close code has been moved to SocketWrapper.close().
+// try
+// {
+// if (socketWrapper != null)
+// {
+// InputStream in = socketWrapper.getInputStream();
+// if (in != null)
+// {
+// in.close();
+// }
+// OutputStream out = socketWrapper.getOutputStream();
+// if (out != null)
+// {
+// out.close();
+// }
+// }
+// }
+// catch (Exception ex)
+// {
+// log.debug("failed to close in/out", ex);
+// }
try
{
More information about the jboss-cvs-commits
mailing list