Throughput of tcpmon is limited to 4096 bytes
---------------------------------------------
Key: AXIS-2509
URL: http://issues.apache.org/jira/browse/AXIS-2509
Project: Apache Axis
Type: Bug
Components: Basic Architecture
Versions: current (nightly), 1.3
Environment: java full version "1.4.2_10-b03"
windows xp professional
apache axis 1.3
Reporter: bert scheel
tcpmon can not handle messages greater than 4096 bytes.
Workaround:
Replace the run() method of the inner class org.apache.utils.tcpmon$SocketRR as
follows and add java.io.ByteArrayOutputStream to imports:
public void run() {
try {
byte[] buffer = new byte[1024];
String message = null;
int reqSaved = 0 ;
int tabWidth = 2 ;
boolean atMargin = true ;
int thisIndent = -1,
nextIndent = -1,
previousIndent = -1;
if ( tmodel != null ) {
String tmpStr = (String) tmodel.getValueAt(tableIndex,
REQ_COLUMN);
if ( !"".equals(tmpStr) ) {
reqSaved = tmpStr.length();
}
}
while(true) {
int bytesRead = 0;
try {
bytesRead = in.read(buffer, 0, buffer.length);
}
catch ( Exception ex ) {
textArea.append("ERROR:" + ex);
ex.printStackTrace();
break;
}
if(-1 == bytesRead) {
break; // end of stream
}
if(null != out) {
slowLink.pump(bytesRead);
out.write(buffer, 0, bytesRead);
}
if ( tmodel != null && reqSaved < 50 ) {
String old = (String) tmodel.getValueAt( tableIndex,
REQ_COLUMN);
old = old + new String(buffer, 0, bytesRead);
if ( old.length() > 50 ) {
old = old.substring(0, 50);
}
reqSaved = old.length();
int index = old.indexOf('\n');
if (index > 0) {
old = old.substring(0, index - 1);
reqSaved = 50 ;
}
tmodel.setValueAt( old, tableIndex, REQ_COLUMN );
}
if ( xmlFormat ) {
// Do XML Formatting
ByteArrayOutputStream byteArrayOutputStream = new
ByteArrayOutputStream();
boolean inXML = false ;
int i2 = 0 ;
for (int i1=0 ; i1 < bytesRead ; i1++ ) {
// Except when we're at EOF
if (i1 + 1 == bytesRead ) {
break;
}
thisIndent = -1;
if ( buffer[i1] == '<' && buffer[i1 + 1] != '/' ) {
previousIndent = nextIndent++;
thisIndent = nextIndent;
inXML = true ;
}
if ( buffer[i1] == '<' && buffer[i1 + 1] == '/' ) {
if (previousIndent > nextIndent) {
thisIndent = nextIndent;
}
previousIndent = nextIndent--;
inXML = true ;
}
if ( buffer[i1] == '/' && buffer[i1 + 1] == '>' ) {
previousIndent = nextIndent--;
inXML = true ;
}
if ( thisIndent != -1 ) {
if ( thisIndent > 0 ) {
byteArrayOutputStream.write((byte) '\n');
}
for (int i = tabWidth * thisIndent; i > 0; i-- ) {
byteArrayOutputStream.write((byte) ' ');
}
}
atMargin = ( buffer[i1] == '\n' || buffer[i1] ==
'\r');
if ( !inXML || !atMargin ) {
byteArrayOutputStream.write(buffer[i1]);
}
}
byte[] byteArray = byteArrayOutputStream.toByteArray();
message = new String(byteArray, 0, byteArray.length,
getEncoding() );
if (numericEnc) {
textArea.append(
StringUtils.escapeNumericChar(message) );
} else {
textArea.append(
StringUtils.unescapeNumericChar(message) );
}
}
else {
message = new String( buffer, 0, bytesRead, getEncoding()
);
if (numericEnc) {
textArea.append(
StringUtils.escapeNumericChar(message) );
} else {
textArea.append(
StringUtils.unescapeNumericChar(message) );
}
}
}
}
catch ( Throwable t ) {
t.printStackTrace();
}
finally {
try {
if (out != null) {
out.flush();
if (null != outSocket) {
outSocket.shutdownOutput();
} else {
out.close();
}
out = null;
}
}
catch (Exception e) {
;
}
try {
if (in != null) {
if (inSocket != null) {
inSocket.shutdownInput();
} else {
in.close();
}
in = null;
}
}
catch (Exception e) {
;
}
myConnection.wakeUp();
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]