dug 02/05/20 05:18:35
Modified: java/src/org/apache/axis/utils tcpmon.java
Log:
Get tcpmon working again
- resend will now work again (not all cases yet but at least some)
- remove some error message (exceptions) that get thrown
Revision Changes Path
1.31 +18 -24 xml-axis/java/src/org/apache/axis/utils/tcpmon.java
Index: tcpmon.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/tcpmon.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- tcpmon.java 17 May 2002 19:09:34 -0000 1.30
+++ tcpmon.java 20 May 2002 12:18:34 -0000 1.31
@@ -443,8 +443,8 @@
int reqSaved = 0 ;
int thisIndent, nextIndent=0 ;
- inSocket.setSoTimeout(10 );
- outSocket.setSoTimeout(10 );
+ if ( inSocket != null ) inSocket.setSoTimeout( 10 );
+ if ( outSocket != null ) outSocket.setSoTimeout( 10 );
for ( ;; ) {
if( done ) break;
@@ -457,14 +457,11 @@
while( len1==0 ) {
try {
len1 = in.read(buffer,saved,len);
- } catch( java.io.InterruptedIOException ex ) {
- //System.out.println("Interrupted exception reading" +
this +
- // " " + done);
+ } catch( Exception ex ) {
len1=0;
if( done ) return;
}
}
- // System.out.println("XXX Read result: " + this + " " +len1 +
" " + out);
len=len1;
if ( len == -1 ) break ;
@@ -572,17 +569,17 @@
boolean active ;
String fromHost ;
String time ;
- JTextArea inputText ;
- JScrollPane inputScroll ;
- JTextArea outputText ;
- JScrollPane outputScroll ;
- Socket inSocket ;
- Socket outSocket ;
- Thread clientThread ;
- Thread serverThread ;
- SocketRR rr1 = null ;
- SocketRR rr2 = null ;
- InputStream inputStream ;
+ JTextArea inputText = null ;
+ JScrollPane inputScroll = null ;
+ JTextArea outputText = null ;
+ JScrollPane outputScroll = null ;
+ Socket inSocket = null ;
+ Socket outSocket = null ;
+ Thread clientThread = null ;
+ Thread serverThread = null ;
+ SocketRR rr1 = null ;
+ SocketRR rr2 = null ;
+ InputStream inputStream = null ;
String HTTPProxyHost = null ;
int HTTPProxyPort = 80 ;
@@ -620,13 +617,10 @@
else HTTPProxyPort = Integer.parseInt( tmp );
}
- if ( inSocket != null ) {
- InetAddress h = inSocket.getInetAddress();
- fromHost = h.getHostName();
- }
- else {
+ if ( inSocket != null )
+ fromHost = (inSocket.getInetAddress()).getHostName();
+ else
fromHost = "resend" ;
- }
DateFormat df = new SimpleDateFormat("MM/dd/yy hh:mm:ss aa");
time = df.format( new Date() );
@@ -678,7 +672,7 @@
int index = listener.connections.indexOf( this );
- if ( listener.isProxyBox.isSelected() || HTTPProxyHost != null ) {
+ if (listener.isProxyBox.isSelected() || HTTPProxyHost != null) {
// Check if we're a proxy
byte[] b = new byte[1];
buf = new StringBuffer();