use of inputport.ConnectionListener in project GIPC by pdewan.
the class AGroupRPCClientLauncher method launchClient.
public static void launchClient(String aName) {
Tracer.showInfo(true);
RelayerClientAndServerSupport.setRelayedCommunicaton(false);
GroupRPCServerInputPort sessionPort = GroupRPCStaticSessionPortSelector.createGroupRPCStaticSessionPort(servers, REMOTE_END_POINT, aName, "Add Servers", ParticipantChoice.SYMMETRIC_JOIN);
ConnectionListener connectListener = new AnOldGroupCallingConnectListener(sessionPort);
sessionPort.addConnectionListener(connectListener);
Adder adder = new AnAdder();
sessionPort.register(Adder.class, adder);
Scanner in = new Scanner(System.in);
String message = in.nextLine();
Tracer.info("About to connect to peers");
sessionPort.connect();
in.nextLine();
}
use of inputport.ConnectionListener in project GIPC by pdewan.
the class ABufferDuplexSessionPortLauncher method launchSessionPartipant.
public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aJoinChoice) {
// Tracer.showInfo(true);
DuplexSessionPort<ByteBuffer> sessionPort = BufferDuplexSessionPortSelector.createBufferDuplexSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, ParticipantChoice.MEMBER);
// DuplexServerInputPort<ByteBuffer> sessionPort = new ADuplexBufferSessionPortFullP2P("localhost",
// "" + ASessionsServer.SESSION_SERVER_PORT, ASessionsServer.SESSION_SERVER_NAME, "Test Session", anId, aName);
// PrintingReplyingReceiveListener printingReplyingReceiveListener = new PrintingReplyingReceiveListener(sessionPort);
ConnectionListener connectListener = new ASendingConnectListener(sessionPort);
// sessionPort.addConnectListener(printingReplyingReceiveListener);
sessionPort.addConnectionListener(connectListener);
sessionPort.addReceiveListener(new ABufferDuplexReceiveListener());
// serverInputPort.addDisconnectListener(echoingReceiveListener);
// sessionPort.addReceiveListener(printingReplyingReceiveListener);
sessionPort.connect();
}
use of inputport.ConnectionListener in project GIPC by pdewan.
the class AnObjectGroupSessionPortLauncher method launchSessionPartipant.
public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aChoice) {
// Tracer.showInfo(true);
RelayerClientAndServerSupport.setRelayedCommunicaton(false);
GroupSessionPort<Object> sessionPort = ObjectGroupSessionPortSelector.createObjectGroupSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, aChoice);
// DuplexServerInputPort<ByteBuffer> sessionPort = new ADuplexBufferSessionPortFullP2P("localhost",
// "" + ASessionsServer.SESSION_SERVER_PORT, ASessionsServer.SESSION_SERVER_NAME, "Test Session", anId, aName);
// PrintingReplyingReceiveListener printingReplyingReceiveListener = new PrintingReplyingReceiveListener(sessionPort);
ConnectionListener connectListener = new AnObjectGroupSendingConnectListener(sessionPort);
// sessionPort.addConnectListener(printingReplyingReceiveListener);
sessionPort.addConnectionListener(connectListener);
sessionPort.addReceiveListener(new AnObjectDuplexReceiveListener());
// serverInputPort.addDisconnectListener(echoingReceiveListener);
// sessionPort.addReceiveListener(printingReplyingReceiveListener);
sessionPort.connect();
}
use of inputport.ConnectionListener in project GIPC by pdewan.
the class AnObjectDuplexSessionPortLauncher method launchSessionPartipant.
public static void launchSessionPartipant(String anId, String aName, ParticipantChoice aJoinChoice) {
// Tracer.showInfo(true);
DuplexSessionPort<Object> sessionPort = ObjectDuplexSessionPortSelector.createObjectDuplexSessionPort("localhost", "" + SESSION_SERVER_PORT, SESSION_SERVER_NAME, "Test Session", anId, aName, aJoinChoice);
ConnectionListener connectListener = new AnObjectSendingConnectListener(sessionPort);
sessionPort.addConnectionListener(connectListener);
sessionPort.addReceiveListener(new AnObjectDuplexReceiveListener());
sessionPort.connect();
}
use of inputport.ConnectionListener in project GIPC by pdewan.
the class ABufferGroupSessionPortLauncher method launchSessionPartipant.
// public static String SESSION_SERVER_NAME = "Sessions Server";
public static void launchSessionPartipant(String anId, String aName) {
// Tracer.showInfo(true);
GroupServerInputPort<ByteBuffer> sessionPort = BufferGroupSessionPortSelector.createBufferGroupSessionPort("localhost", "" + SESSION_SERVER_PORT, SessionServerLauncher.SESSION_SERVER_NAME, "Test Session", anId, aName, ParticipantChoice.MEMBER);
// DuplexServerInputPort<ByteBuffer> sessionPort = new ADuplexBufferSessionPortFullP2P("localhost",
// "" + ASessionsServer.SESSION_SERVER_PORT, ASessionsServer.SESSION_SERVER_NAME, "Test Session", anId, aName);
// PrintingReplyingReceiveListener printingReplyingReceiveListener = new PrintingReplyingReceiveListener(sessionPort);
ConnectionListener connectListener = new AGroupSendingConnectListener(sessionPort);
// sessionPort.addConnectListener(printingReplyingReceiveListener);
sessionPort.addConnectionListener(connectListener);
sessionPort.addReceiveListener(new ABufferDuplexReceiveListener());
// serverInputPort.addDisconnectListener(echoingReceiveListener);
// sessionPort.addReceiveListener(printingReplyingReceiveListener);
sessionPort.connect();
}
Aggregations