aboutsummaryrefslogtreecommitdiff
path: root/src/Ghost.java
diff options
context:
space:
mode:
authorjestin2006-08-03 15:54:54 +0000
committerjestin2006-08-03 15:54:54 +0000
commitaff598c9c6364059fb3e698f955ed524ee4e081d (patch)
treefbd952914f801904f1367c13aa7ade979fd676ba /src/Ghost.java
parent00d407a82a4f54407ca5d2201d3ec91054c014a9 (diff)
downloadivy-java-aff598c9c6364059fb3e698f955ed524ee4e081d.zip
ivy-java-aff598c9c6364059fb3e698f955ed524ee4e081d.tar.gz
ivy-java-aff598c9c6364059fb3e698f955ed524ee4e081d.tar.bz2
ivy-java-aff598c9c6364059fb3e698f955ed524ee4e081d.tar.xz
a few changes towards the tunnel manager
Diffstat (limited to 'src/Ghost.java')
-rw-r--r--src/Ghost.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/Ghost.java b/src/Ghost.java
index fd7465d..f8f76cf 100644
--- a/src/Ghost.java
+++ b/src/Ghost.java
@@ -18,25 +18,30 @@ 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 {
+ 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;
- System.out.println("new Ghost: "+id+" pc:"+pc);
+ System.out.println("Ghost["+id+"] created");
}
// ProxyClient -> Ghost -> Ivy Bus
- protected synchronized void sendBuffer( String buffer ) throws IvyException {
- // System.out.println("out buffer: "+buffer+" for:"+pc+" id:"+id);
- super.sendBuffer(buffer); // and to all the agents on the Ghost bus ? I'm not sure
+ protected synchronized void sendBuffer( String s ) throws IvyException {
+ System.out.println("Ghost["+id+"] sending ["+s+"]");
+ super.sendBuffer(s); // and to all the agents on the Ghost bus ? I'm not sure
}
// Bus -> Ghost -> ProxyClient -> ProxyMaster -> other buses
protected boolean newParseMsg(String s) throws IvyException {
// I received a message from an agent on the bus
- System.out.println("in buffer to forward from "+id+": "+s);
- if (pc!=null) pc.forward(id,s); // forward to all the puppets
- return super.newParseMsg(s); // I'll take no action
+ if (pc!=null) {
+ System.out.println("Ghost["+id+"] forwarding ["+s+"]");
+ pc.forwardPuppet(id,s); // forward to all the puppets
+ } else {
+ System.out.println("Warning, Ghost ["+id+"] could not forward ["+s+"] to null pc");
+ }
+ return super.newParseMsg(s); // I'm a normal Ivy citizen
}
}