org.openorb.orb.util
Class DebugSocketInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--org.openorb.orb.util.DebugSocketInputStream

public class DebugSocketInputStream
extends java.io.InputStream

This class can be used for debugging IIOP traffic on the socket layer. Analyzing the network traffic with tools like Ethereal make it hard to keep track of the traffic on the GIOP/IIOP layer. Especially in a multi-threaded application where multiple threads write on the same socket. The class creates a folder in the os default temp directory: ${java.io.tmp}/${user.name}/<TIMESTAMP>/input which contains the socket traffic files: [localhost].[localport]-[remotehost].[remoteport].[TIMESTAMP].log Each files contains a history of which bytes have been read by which thread from the stream.

Author:
Michael Rumpf

Constructor Summary
DebugSocketInputStream(java.io.InputStream parent, long timestamp, java.lang.String description)
          Constructor.
 
Method Summary
 void close()
           
 int read()
           
 int read(byte[] buf)
           
 int read(byte[] buf, int off, int len)
           
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugSocketInputStream

public DebugSocketInputStream(java.io.InputStream parent,
                              long timestamp,
                              java.lang.String description)
                       throws java.io.IOException
Constructor.
Parameters:
parent - The parent input stream.
timestamp - The VM wide timestamp to identify this process.
description - The socket description generated from the socket.
Method Detail

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.InputStream

read

public int read(byte[] buf)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream

read

public int read(byte[] buf,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream

close

public void close()
           throws java.io.IOException
Overrides:
close in class java.io.InputStream