Search in sources :

Example 11 with AServerPortDescription

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;
    }
}
Also used : AServerPortDescription(port.sessionserver.AServerPortDescription) ServerPortDescription(port.sessionserver.ServerPortDescription) RelayingSession(port.sessionserver.relay.RelayingSession) ARelayingSession(port.sessionserver.relay.ARelayingSession) AServerPortDescription(port.sessionserver.AServerPortDescription) ARelayingSession(port.sessionserver.relay.ARelayingSession)

Example 12 with AServerPortDescription

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());
}
Also used : AServerPortDescription(port.sessionserver.AServerPortDescription) APrintingSessionObserver(port.sessionserver.example.APrintingSessionObserver)

Aggregations

AServerPortDescription (port.sessionserver.AServerPortDescription)12 ServerPortDescription (port.sessionserver.ServerPortDescription)9 GroupRPCServerInputPort (inputport.rpc.group.GroupRPCServerInputPort)6 DuplexRPCClientInputPort (inputport.rpc.duplex.DuplexRPCClientInputPort)3 RelayerSupportingSessionServer (port.sessionserver.relay.RelayerSupportingSessionServer)3 ARelayer (port.relay.ARelayer)2 Relayer (port.relay.Relayer)2 APrintingSessionObserver (port.sessionserver.example.APrintingSessionObserver)2 DuplexRPCServerInputPort (inputport.rpc.duplex.DuplexRPCServerInputPort)1 GenericRelayingCollaborativeFrostyModel (port.relay.mvc.example.GenericRelayingCollaborativeFrostyModel)1 JoinInfo (port.sessionserver.JoinInfo)1 SessionObserver (port.sessionserver.SessionObserver)1 SessionServer (port.sessionserver.SessionServer)1 ARelayerSupportingSessionServer (port.sessionserver.relay.ARelayerSupportingSessionServer)1 ARelayingSession (port.sessionserver.relay.ARelayingSession)1 RelayingSession (port.sessionserver.relay.RelayingSession)1 LatecomerSessionServer (port.sessionserver.relay.late.LatecomerSessionServer)1 Adder (sessionport.rpc.duplex.relayed.example.Adder)1 AnAdder (sessionport.rpc.duplex.relayed.example.AnAdder)1