/** * Initializes the session using the parameters given in the XML configuration. Possible * parameters: * * <ul> * <li><b>local_address</b> the address to which the UDP socket is bound. * <li><b>max_udp_message_size</b> the maximum size of an underlying UDP message payload. * <li><b>reader_sotimeout</b> the timeout of the threads that listen on UDP sockets. (in * milliseconds) * </ul> * * @param params The parameters given in the XML configuration. */ public void init(SessionProperties params) { if (params.containsKey("local_address")) { try { param_LOCAL_ADDRESS = InetAddress.getByName(params.getString("local_address")); } catch (UnknownHostException e) { System.err.println( "UDP: Unknown host \"" + params.getString("local_address") + "\". Using default."); param_LOCAL_ADDRESS = null; } } if (params.containsKey("max_udp_message_size")) param_MAX_UDPMSG_SIZE = params.getInt("max_udp_message_size"); if (params.containsKey("reader_sotimeout")) param_SOTIMEOUT = params.getInt("reader_sotimeout"); }
/** * In the xml file, on the tag <i>channel</i> Integrity Session must have one parameter called * <i>secret</i> * * @param params */ public void init(SessionProperties params) { secret = params.getString("secret").getBytes(); }