use of port.sessionserver.AServerPortDescription 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.AServerPortDescription in project GIPC by pdewan.
the class ASessionMemberMVCServerLauncher method doPostConnectsAsyncOperations.
protected void doPostConnectsAsyncOperations() {
String myHostName = "localhost";
try {
myHostName = InetAddress.getLocalHost().getHostName();
} catch (Exception e) {
e.printStackTrace();
}
sessionServerProxy.joinAsServer(sessionName, new AServerPortDescription(myHostName, serverId, serverName), new APrintingSessionObserver());
}
Aggregations