Esempio n. 1
0
  private void establishConnection() throws IOException {

    Socket socket = new Socket(connectionInfo.getHostName(), connectionInfo.getPortNum());

    slaveSocket = new SlaveClientSocket(session.getID(), socket, new MyListener());
    slaveSocket.initialize();
  }
Esempio n. 2
0
  /**
   * Create a new instance of ServerProxySlave.
   *
   * @param client The slave client.
   * @param session This app's Wonderland session.
   * @param connectionInfo Subclass-specific data for making a peer-to-peer connection between
   *     master and slave.
   * @param disconnectListener The listener to call when the slave is disconnected.
   */
  public ServerProxySlave(
      ClientXrwSlave client,
      WonderlandSession session,
      AppXrwConnectionInfo connectionInfo,
      DisconnectListener disconnectListener) {
    this.client = client;
    this.session = session;
    this.connectionInfo = connectionInfo;
    this.disconnectListener = disconnectListener;

    try {
      this.mac = Mac.getInstance("HmacSHA1");
      mac.init(connectionInfo.getSecret());
    } catch (NoSuchAlgorithmException nsae) {
      throw new IllegalStateException(nsae);
    } catch (InvalidKeyException ike) {
      throw new IllegalStateException(ike);
    }
  }