use of port.sessionserver.ServerPortDescription in project GIPC by pdewan.
the class ARelayerCreator method registerWithSessionsServer.
public static void registerWithSessionsServer(String relayerId, String relayerName, String sessionsServerHost, String sessionsServerId, String sessionsServerName) {
ServerPortDescription serverPortDescription = new AServerPortDescription("localhost", relayerId, relayerName);
DuplexRPCClientInputPort sessionServerClientPort = DuplexRPCInputPortSelector.createDuplexRPCClientInputPort(sessionsServerHost, sessionsServerId, sessionsServerName, relayerName);
RelayerSupportingSessionServer sessionsServer = (RelayerSupportingSessionServer) DirectedRPCProxyGenerator.generateRPCProxy(sessionServerClientPort, null, RelayerSupportingSessionServer.class, sessionsServerName);
sessionServerClientPort.connect();
sessionsServer.setRelayerDescripton(serverPortDescription);
}
use of port.sessionserver.ServerPortDescription in project GIPC by pdewan.
the class ABufferDuplexStaticSessionPortFullP2P method createServerPort.
// this is the part that multiserver port does not have to do. Hence multiserver port cannot be subclass of static port
protected void createServerPort() {
try {
ServerPortDescription aServerPortDescription = new AServerPortDescription(InetAddress.getLocalHost().getHostName(), id, name);
Tracer.info(this, "Asking connections manager to create server port for P2P connections");
bufferStaticSessionConnectionManager.createServerInputPort(aServerPortDescription);
} catch (Exception e) {
e.printStackTrace();
}
}
use of port.sessionserver.ServerPortDescription in project GIPC by pdewan.
the class CopyOfARelayingSessionsServer method createSession.
@Override
protected Session createSession(String aSessionName) {
try {
ServerPortDescription serverPortDescription = new AServerPortDescription(InetAddress.getLocalHost().getHostName(), "" + nextServerId, aSessionName);
nextServerId++;
DuplexServerInputPort<Object> port = DuplexObjectInputPortSelector.createDuplexServerInputPort(serverPortDescription.getID(), serverPortDescription.getName());
port.addConnectionListener(this);
port.connect();
// wait();
RelayingSession session = new ARelayingSession();
// nameToSession.put(aSessionName, session);
session.setRelayingPort(port);
session.setServerPortDescription(serverPortDescription);
return session;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
use of port.sessionserver.ServerPortDescription in project GIPC by pdewan.
the class AThreeDepPortClientLauncher method communicateWithSessionServer.
protected void communicateWithSessionServer() {
ServerPortDescription relayerPortDescription = sessionServerProxy.getRelayerDescripton(sessionName);
JoinInfo joinInfo = joinSessionServer();
ServerPortDescription mvcServerPortDescription = null;
List<SessionParticipantDescription> servers = joinInfo.getServers();
if (servers.size() > 0) {
mvcServerPortDescription = servers.get(0);
} else {
mvcServerHasNotJoined();
}
processMemberJoinInfo(joinInfo);
chainConnectListeners(relayerPortDescription, mvcServerPortDescription);
}
Aggregations