jakarta-jcs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asm...@apache.org
Subject cvs commit: jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp LateralTCPSender.java
Date Thu, 15 Apr 2004 06:29:43 GMT
asmuts      2004/04/14 23:29:43

  Modified:    src/java/org/apache/jcs/auxiliary/lateral/socket/tcp
                        LateralTCPSender.java
  Log:
  I put a socket cleanup into the sendandreceive method.
  
  This needs further consideration, but it seems prudent.
  
  I still don't recommend using the lateral for gets.
  
  Revision  Changes    Path
  1.7       +16 -1     jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java
  
  Index: LateralTCPSender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/lateral/socket/tcp/LateralTCPSender.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LateralTCPSender.java	22 Aug 2003 11:57:18 -0000	1.6
  +++ LateralTCPSender.java	15 Apr 2004 06:29:43 -0000	1.7
  @@ -272,6 +272,21 @@
           {
               try
               {
  +
  +                try
  +                {
  +                  //  clean up input stream, nothing should be there yet.
  +                  if ( socket.getInputStream().available() > 0 )
  +                  {
  +                    socket.getInputStream().read( new byte[socket.getInputStream().available()]
);
  +                  }
  +                }
  +                catch ( IOException ioe )
  +                {
  +                  log.error( "Problem cleaning socket before send " + socket, ioe );
  +                }
  +
  +                // write object to listener
                   oos.writeObject( led );
                   oos.flush();
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-jcs-dev-help@jakarta.apache.org


Mime
View raw message