You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Peter Wilkinson <pw...@thirdfloor.com.au> on 2000/07/14 03:26:31 UTC

quick mod for TcpTunnel

I've made a quick and dirty mod to Relay.java so that I can run the tunnel
from a command line and see the output, rather than having to run the AWT
version.

Feel free to add or ignore as you see fit.

Index: xml-soap/java/src/org/apache/soap/util/net/Relay.java
===================================================================
RCS file:
/home/cvspublic/xml-soap/java/src/org/apache/soap/util/net/Relay.java,v
retrieving revision 1.2
diff -r1.2 Relay.java
93a94,96
>     else {
>       System.out.println (new String (buf, 0, n));
>     }

PeterW.


RE: quick mod for TcpTunnel

Posted by Peter Wilkinson <pw...@thirdfloor.com.au>.
> Subject: Re: quick mod for TcpTunnel
>
>
> THis is certainly a useful mod, but I'd suggest putting in an
> option to
> the command line driver to enable this. I wrote this code a long time
> ago so that I could check email from a 2nd machine at home .. and at
> that time the non-GUI version was used to relay the stuff without
> any need to see what was going on. I don't want to disable that usage
> I think.
>
> If u can send in both the mods I'll be happy to commit it.
>
> Sanjiva.

Here is a better patch. Still fairly nasty but ok. I'm working on getting a
more complete command line client happening, better options support
exception handling etc. but this does the job for now. I'm looking to move
the AWT stuff out of Relay.java too so that is more generalised.

PeterW.



Index: xml-soap/java/src/org/apache/soap/util/net/Relay.java
===================================================================
RCS file:
/home/cvspublic/xml-soap/java/src/org/apache/soap/util/net/Relay.java,v
retrieving revision 1.2
diff -r1.2 Relay.java
76a77
>   PrintStream log;
83a85,91
>   Relay (InputStream in, OutputStream out, PrintStream log) {
>     this.in = in;
>     this.out = out;
>     this.log = log;
>   }
>
>
93a102,104
>     else if (log != null) {
>       log.println (new String (buf, 0, n));
>     }
104c115
< }
\ No newline at end of file
---
> }
Index: xml-soap/java/src/org/apache/soap/util/net/TcpTunnel.java
===================================================================
RCS file:
/home/cvspublic/xml-soap/java/src/org/apache/soap/util/net/TcpTunnel.java,v
retrieving revision 1.2
diff -r1.2 TcpTunnel.java
72,73c72,73
<     if (args.length != 3) {
<       System.err.println ("Usage: java TcpTunnel listenport tunnelhost
tunnelport");
---
>     if (args.length < 3) {
>       System.err.println ("Usage: java TcpTunnel listenport tunnelhost
tunnelport [output]");
80a81,88
>     PrintStream out = null;
>     if (args.length == 4) {
>       out = System.out;
>     }
>     else {
>       out = null;
>     }
>
97,98c105,106
<       new Relay (sc.getInputStream(), st.getOutputStream(), null).start
();
<       new Relay (st.getInputStream(), sc.getOutputStream(), null).start
();
---
>       new Relay (sc.getInputStream(), st.getOutputStream(), out).start ();
>       new Relay (st.getInputStream(), sc.getOutputStream(), out).start ();


RE: quick mod for TcpTunnel

Posted by Peter Wilkinson <pw...@thirdfloor.com.au>.
> Subject: Re: quick mod for TcpTunnel
>
>
> THis is certainly a useful mod, but I'd suggest putting in an
> option to
> the command line driver to enable this. I wrote this code a long time
> ago so that I could check email from a 2nd machine at home .. and at
> that time the non-GUI version was used to relay the stuff without
> any need to see what was going on. I don't want to disable that usage
> I think.
>
> If u can send in both the mods I'll be happy to commit it.
>
> Sanjiva.

Here is a better patch. Still fairly nasty but ok. I'm working on getting a
more complete command line client happening, better options support
exception handling etc. but this does the job for now. I'm looking to move
the AWT stuff out of Relay.java too so that is more generalised.

PeterW.



Index: xml-soap/java/src/org/apache/soap/util/net/Relay.java
===================================================================
RCS file:
/home/cvspublic/xml-soap/java/src/org/apache/soap/util/net/Relay.java,v
retrieving revision 1.2
diff -r1.2 Relay.java
76a77
>   PrintStream log;
83a85,91
>   Relay (InputStream in, OutputStream out, PrintStream log) {
>     this.in = in;
>     this.out = out;
>     this.log = log;
>   }
>
>
93a102,104
>     else if (log != null) {
>       log.println (new String (buf, 0, n));
>     }
104c115
< }
\ No newline at end of file
---
> }
Index: xml-soap/java/src/org/apache/soap/util/net/TcpTunnel.java
===================================================================
RCS file:
/home/cvspublic/xml-soap/java/src/org/apache/soap/util/net/TcpTunnel.java,v
retrieving revision 1.2
diff -r1.2 TcpTunnel.java
72,73c72,73
<     if (args.length != 3) {
<       System.err.println ("Usage: java TcpTunnel listenport tunnelhost
tunnelport");
---
>     if (args.length < 3) {
>       System.err.println ("Usage: java TcpTunnel listenport tunnelhost
tunnelport [output]");
80a81,88
>     PrintStream out = null;
>     if (args.length == 4) {
>       out = System.out;
>     }
>     else {
>       out = null;
>     }
>
97,98c105,106
<       new Relay (sc.getInputStream(), st.getOutputStream(), null).start
();
<       new Relay (st.getInputStream(), sc.getOutputStream(), null).start
();
---
>       new Relay (sc.getInputStream(), st.getOutputStream(), out).start ();
>       new Relay (st.getInputStream(), sc.getOutputStream(), out).start ();


Re: quick mod for TcpTunnel

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
THis is certainly a useful mod, but I'd suggest putting in an option to
the command line driver to enable this. I wrote this code a long time 
ago so that I could check email from a 2nd machine at home .. and at
that time the non-GUI version was used to relay the stuff without 
any need to see what was going on. I don't want to disable that usage
I think.

If u can send in both the mods I'll be happy to commit it.

Sanjiva.

----- Original Message ----- 
From: "Peter Wilkinson" <pw...@thirdfloor.com.au>
To: <so...@xml.apache.org>
Sent: Thursday, July 13, 2000 9:26 PM
Subject: quick mod for TcpTunnel


> I've made a quick and dirty mod to Relay.java so that I can run the tunnel
> from a command line and see the output, rather than having to run the AWT
> version.
> 
> Feel free to add or ignore as you see fit.
> 
> Index: xml-soap/java/src/org/apache/soap/util/net/Relay.java
> ===================================================================
> RCS file:
> /home/cvspublic/xml-soap/java/src/org/apache/soap/util/net/Relay.java,v
> retrieving revision 1.2
> diff -r1.2 Relay.java
> 93a94,96
> >     else {
> >       System.out.println (new String (buf, 0, n));
> >     }
> 
> PeterW.
> 


Re: quick mod for TcpTunnel

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
THis is certainly a useful mod, but I'd suggest putting in an option to
the command line driver to enable this. I wrote this code a long time 
ago so that I could check email from a 2nd machine at home .. and at
that time the non-GUI version was used to relay the stuff without 
any need to see what was going on. I don't want to disable that usage
I think.

If u can send in both the mods I'll be happy to commit it.

Sanjiva.

----- Original Message ----- 
From: "Peter Wilkinson" <pw...@thirdfloor.com.au>
To: <so...@xml.apache.org>
Sent: Thursday, July 13, 2000 9:26 PM
Subject: quick mod for TcpTunnel


> I've made a quick and dirty mod to Relay.java so that I can run the tunnel
> from a command line and see the output, rather than having to run the AWT
> version.
> 
> Feel free to add or ignore as you see fit.
> 
> Index: xml-soap/java/src/org/apache/soap/util/net/Relay.java
> ===================================================================
> RCS file:
> /home/cvspublic/xml-soap/java/src/org/apache/soap/util/net/Relay.java,v
> retrieving revision 1.2
> diff -r1.2 Relay.java
> 93a94,96
> >     else {
> >       System.out.println (new String (buf, 0, n));
> >     }
> 
> PeterW.
>