Author: ron.sigal(a)jboss.com
Date: 2013-11-03 19:48:43 -0500 (Sun, 03 Nov 2013)
New Revision: 6509
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ClientSocketWrapper.java
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/TimedOutputStream.java
Log:
JBREM-1307: Backing out TimedOutputStream changes due to SSL test failures.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ClientSocketWrapper.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ClientSocketWrapper.java 2013-11-03
04:40:02 UTC (rev 6508)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/ClientSocketWrapper.java 2013-11-04
00:48:43 UTC (rev 6509)
@@ -125,7 +125,6 @@
// Public
---------------------------------------------------------------------------------------
-
public String toString()
{
Socket socket = getSocket();
@@ -221,7 +220,7 @@
OutputStream os = socket.getOutputStream();
if (writeTimeout > 0)
{
- os = new TimedOutputStream(os, socket, writeTimeout);
+ os = new TimedOutputStream(os, writeTimeout);
}
if (marshaller instanceof PreferredStreamMarshaller)
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/TimedOutputStream.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/TimedOutputStream.java 2013-11-03
04:40:02 UTC (rev 6508)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/TimedOutputStream.java 2013-11-04
00:48:43 UTC (rev 6509)
@@ -24,18 +24,17 @@
import java.io.IOException;
import java.io.OutputStream;
-import java.net.Socket;
import java.util.Timer;
import java.util.TimerTask;
import org.jboss.logging.Logger;
/**
- * @author <a href="ron.sigal(a)jboss.com"Ron Sigal</a
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
* @version $Rev$
- * <p
+ * <p>
* Copyright April 22, 2009
- * </p
+ * </p>
*/
public class TimedOutputStream extends OutputStream
{
@@ -44,14 +43,12 @@
private OutputStream os;
private int outputTimeout;
- private Socket socket;
private OutputTimerTask timerTask;
private Object lock = new Object();
- public TimedOutputStream(OutputStream os, Socket socket, int outputTimeout)
+ public TimedOutputStream(OutputStream os, int outputTimeout)
{
this.os = os;
- this.socket = socket;
this.outputTimeout = outputTimeout;
}
@@ -131,16 +128,6 @@
}
}
- public Socket getSocket()
- {
- return socket;
- }
-
- public void setSocket(Socket socket)
- {
- this.socket = socket;
- }
-
static class OutputTimerTask extends TimerTask
{
private TimedOutputStream tos;
@@ -152,56 +139,16 @@
public void run()
{
-// try
-// {
-// log.debug(this + " closing: " + tos);
-// tos.close();
-// tos = null;
-// }
-// catch (IOException e)
-// {
-// log.debug("unable to close " + tos);
-// }
try
{
- Socket mySocket = tos.getSocket();
- if (mySocket != null)
- {
- // set the linger on with duration 0, results RST being sent
- // and socket send and receive buffers being discarded (does not
- // wait of the existing write() to complete]. There is no use in
- // setting the soLingerDuration longer then 0 (thus waiting for the write
to
- // complete), since we've already waited "writeTimeout"
seconds on this write.
- //
- // Thank you, Todd Sandor!! -ron
- boolean on = true;
- int soLingerDuration = 0;
- log.debug(this + " socketWrite TIMEOUT: set soLinger(ON,0): " +
tos);
- mySocket.setSoLinger(on, soLingerDuration);
- }
+ log.debug(this + " closing: " + tos);
+ tos.close();
+ tos = null;
}
catch (IOException e)
{
- log.debug(" socketWrite TIMEOUT: Attempting to set linger on socket
stream [" + tos +
- "], Exception [" + e.toString() + "]");
+ log.debug("unable to close " + tos);
}
- finally
- {
- log.debug(this + " socketWrite TIMEOUT: close(): " + tos);
- try
- {
- tos.close();
- }
- catch (Exception e)
- {
- // ignore - log error
- log.error("Failed to close() socket stream Exception: ", e);
- tos = null;
- return;
- }
- log.debug(this + " socketWrite TIMEOUT: close() completed.");
- tos = null;
- }
}
public boolean cancel()
Show replies by date