From 21cec28549587db7e34d0ac455244fe4d73a0ed4 Mon Sep 17 00:00:00 2001 From: jestin Date: Tue, 1 Aug 2006 15:52:16 +0000 Subject: Changes to allow the creation of a tunnel between two (or more) ivy bussssseeeeezzzz --- src/Ghost.java | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/Ghost.java (limited to 'src/Ghost.java') diff --git a/src/Ghost.java b/src/Ghost.java new file mode 100644 index 0000000..ad6e78c --- /dev/null +++ b/src/Ghost.java @@ -0,0 +1,39 @@ +/** + * the Ghost peers on the bus ( Proxy scheme ) + * + * @author Yannick Jestin + * @author http://www.tls.cena.fr/products/ivy/ + * + * CHANGELOG: + * 1.2.12 + */ +package fr.dgac.ivy ; +import java.io.*; +import java.net.*; +import java.util.*; +import org.apache.regexp.*; + +class Ghost extends IvyClient { + + private String id; // given to the Proxy by the Master + private ProxyClient pc; + + Ghost(Ivy bus, Socket socket,int remotePort,boolean incoming,String id,ProxyClient pc) throws IOException { + super(bus,socket,remotePort,incoming); + this.id=id; + this.pc=pc; + } + + protected synchronized void sendBuffer( String buffer ) throws IvyException { + System.out.println("out buffer: "+buffer); + pc.forward(id,buffer); + super.sendBuffer(buffer); + } + + protected boolean newParseMsg(String s) throws IvyException { + System.out.println("in buffer: "+s); + pc.forward(id,buffer); + return super.newParseMsg(s); + } + +} -- cgit v1.1