User: pkendall
Date: 01/07/31 18:18:22
Modified: src/main/org/jbossmq/il/uil UILServerILService.java
UILClientILService.java
Log:
Make the sockets fully blocking and close the socket when stopping. This is to work
around a bug in Sun's JDK sockets i.e. they don't throw InterruptedException on
timeout, you get a EOFException and the socket is then stuffed.
Revision Changes Path
1.6 +8 -9 jbossmq/src/main/org/jbossmq/il/uil/UILServerILService.java
Index: UILServerILService.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/il/uil/UILServerILService.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- UILServerILService.java 2001/07/31 21:36:13 1.5
+++ UILServerILService.java 2001/08/01 01:18:22 1.6
@@ -38,6 +38,7 @@
import javax.jms.TemporaryQueue;
import org.jbossmq.TransactionRequest;
import java.io.IOException;
+import java.io.EOFException;
import org.jbossmq.SpyDestination;
/**
@@ -45,7 +46,7 @@
* manage the JVM IL.
*
* @author Hiram Chirino ([EMAIL PROTECTED])
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class UILServerILService extends ServerILJMXService implements
UILServerILServiceMBean, Runnable {
@@ -159,6 +160,7 @@
if( !running )
return;
+ socket.setSoTimeout(0);
new Thread(this,"UIL Worker").start();
mSocket = new SocketMultiplexor(socket);
@@ -174,18 +176,15 @@
return;
}
-
while (!closed && running) {
try {
-
- //socket.setSoTimeout(SO_TIMEOUT);
code=in.readByte();
-
- } catch ( java.io.InterruptedIOException e ) {
- if( !closed && !running )
- continue;
- } catch (IOException e) {
+ }
+ catch ( EOFException e ) {
+ break;
+ }
+ catch (IOException e) {
if( closed || !running )
break;
1.3 +3 -7 jbossmq/src/main/org/jbossmq/il/uil/UILClientILService.java
Index: UILClientILService.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/il/uil/UILClientILService.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- UILClientILService.java 2001/07/16 02:51:46 1.2
+++ UILClientILService.java 2001/08/01 01:18:22 1.3
@@ -29,7 +29,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class UILClientILService implements org.jbossmq.il.ClientILService, Runnable
{
//the client IL
@@ -108,15 +108,11 @@
while (running) {
try {
- cat.debug("Waiting for a request");
+ cat.debug("Waiting for a messgage from the server");
code = in.readByte();
- cat.debug("Got it");
-
+ } catch (java.io.InterruptedIOException e) {
+ continue;
} catch (IOException e) {
- if (running)
- break;
-
- connection.asynchFailure("Connection failure", e);
break;
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development