Package com.sun.multicast.reliable.applications.slingerSwing

Sample file transfer application.

See:
          Description

Package com.sun.multicast.reliable.applications.slingerSwing Description

Sample file transfer application.

Slinger's command-line interface is very simple. Input is provided via command line arguments and configuration files. When Slinger starts up, it parses its command line arguments and configuration files, merging them into its configuration. Anything specified on the command line overrides the configuration files. If an error is found, an error message is printed to standard error and Slinger exits.

Slinger supports two sets of command line arguments, one for senders, the other for receivers.

java com.sun.multicast.reliable.applications.slinger.SlingerSwing

[-send pathname(s)]

[-address address] [-application an]

[-authenticationSpec pathname]

[-authenticationPassword pw] [-channel cn]

[-cipherSpec pathname] [-cipherPassword pw]

[-config cfile] [-delay interval] [-linger interval]

[-logfile pathname] [-noGUI] [-port port]

[-speed bytesPerSec] [-transport tname] [–ttl ttl]

[-uport uport] [-verbose]

 

java com.sun.multicast.reliable.applications.slinger.SlingerSwing

[-receive directory]

[-application an] [-authenticationSpec pathname]

[-channel cn] [-cipherSpec pathname]

[-cipherPassword pw] [-config cfile]

[-logfile pathname] [-noGUI] [-verbose]

[-uport uport] [-wait interval]

 

If the -send flag is supplied, Slinger will send the named file(s) to a set of receivers. The filenames may be pathnames. The file(s) must already exist. If the -receive flag is supplied, Slinger will wait to receive file(s) from a sender and place them in the named directory. The directory must already exist. At most one of these flags may be supplied on the command line. If neither one is on the command line, the configuration files must contain a setting for this value.

OPTIONS

-address address Use this multicast address for communication. This flag is only valid when Slinger is sending. If this flag is not on the command line, the configuration files must contain a setting for it.

-application an Set the application name to an. The default application name is slingerApplication.

-authenticationPassword pw This is the password which was specified to the AuthenticationSpec class to create the authenticationSpec files. A description of the arguments for this class is given in the section on security. Only the sender specifies this password since it is used to protect the sender’s private key used for signing messages. The receiver does not need a password because the receiver uses the sender’s public key to verify the signature and the public key need not be protected.

-authenticationSpec pathname This is the path to the authenticationSpec files. The sender must use the sender spec output from the AuthenticationSpec class and the receivers must use the receiver spec output from the AuthenticationSpec class. Details of this class are given below in the section on security.

-channel cn Set the channel name to cn. The default channel name is slingerChannel.

-config cfile Use this configuration file instead of slingerProperties. This flag may be used to quickly change Slinger properties en masse.

-cipherPassword pw This is the password used by the CipherSpec class to create the cipher spec file. A description of the arguments for this class is given below in the section on security. The sender and all receivers must know this password since the password protects the symmetric key used to encrypt the traffic.

-cipherSpec pathname This is the path to the cipherSpec file. The sender and all receivers must use copies of the same cipherSpec file.

-delay interval Delay this many seconds before sending. This flag is only valid when Slinger is sending. The default is 60 (one minute). For all but the first file sent, the default delay time is 3 seconds.

-headonly Use this instance of Slinger as a repair node only.

-linger interval Set the linger interval to this value. This flag is only valid when Slinger is sending. The linger interval is sent in the header packet. It tells receivers how long they should wait without receiving a packet before assuming the transmission has been terminated. The default is 60 (one minute).

-logfile pathname Log messages to the file specified by pathname. This is useful for debugging.

-noGUI: Get input parameters from command-line arguments and configuration files only. Start running immediately without displaying a GUI.

-port port Use this port for communication. This flag is only valid when Slinger is sending. If this flag is not on the command line, the configuration files must contain a setting for it.

-speed bytesPerSec Set the transmission rate to this value. This flag is valid only when Slinger is sending. Note that this value is only advisory. The actual rate of transmission may be less than the value requested. The default is 25000 bytes/sec.

-ttl ttl Use this TTL value for communication. This flag is only valid when Slinger is sending. If this flag is not on the command line and sending has been requested, the configuration files must contain a setting for it.

-transport tname Use the transport with this name. This flag is valid only when Slinger is sending. If this flag is not on the command line, the configuration files must contain a setting for it. The only valid transport names for this version of Slinger are Unreliable Multicast (UM) and TRAM.

-uport uport Set the unicast port for exchange of control messages.

-verbose Provide verbose progress and diagnostic messages.

-wait interval Set the wait interval to this value. This flag is only valid when Slinger is receiving. At the start of the transmission, the receiver will wait this number of seconds without receiving a packet before assuming the transmission has been canceled. The default is 300 (five minutes). For all the first file, the default wait time is 5 seconds.

Configuration Files

The Slinger configuration files provide an alternative to specifying settings on the command line. This is a convenient way to avoid typing the same command line arguments again and again. Command line arguments always override settings provided in configuration files.

Slinger uses the Java Properties class to parse its configuration files. Therefore, the file format is a sequence of lines of ASCII text of the form propertyName=value.

Slinger looks for a configuration file named slingerProperties.cfg in the current directory when it starts up. If it finds such a file, it parses it. Otherwise, Slinger moves directly to parsing the command line. The configuration file can be created and managed with a text editor. The configuration file can also be managed by Slinger using a configuration option in the GUI to save the current settings to the configuration file. The path to the configuration file can also be changed in the GUI.

For each command-line argument, there is a corresponding configuration file property with the name slinger.<argument>. For example, the -address command-line argument is the configuration property slinger.address. So -address <address> corresponds to slinger.address=<address>.

Click here for source code



JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.