Exemplo n.º 1
0
  /**
   * Returns a Connection object with the specified properties and a network and address type of
   * "IN" and "IP4" respectively.
   *
   * @param addr connection address
   * @param ttl time to live (TTL) for multicast addresses
   * @param numAddrs number of addresses used by the connection
   * @return Connection
   */
  public Connection createConnection(String addr, int ttl, int numAddrs) throws SdpException {
    ConnectionField connectionImpl = new ConnectionField();

    connectionImpl.setAddress(addr);

    return connectionImpl;
  }
Exemplo n.º 2
0
  /**
   * Returns a Connection object with the specified properties and no TTL and a default number of
   * addresses (1).
   *
   * @param netType network type, eg "IN" for "Internet"
   * @param addrType address type, eg "IP4" for IPv4 type addresses
   * @param addr connection address
   * @throws SdpException if the parameters are null
   * @return Connection
   */
  public Connection createConnection(String netType, String addrType, String addr)
      throws SdpException {
    ConnectionField connectionImpl = new ConnectionField();

    connectionImpl.setNetworkType(netType);
    connectionImpl.setAddressType(addrType);
    connectionImpl.setAddress(addr);

    return connectionImpl;
  }