Skip to content
Snippets Groups Projects
Commit e1bcd435 authored by Brutzman, Don's avatar Brutzman, Don
Browse files

try/catch in main

parent bcda7f4a
No related branches found
No related tags found
No related merge requests found
...@@ -491,7 +491,7 @@ public class PduPlayer { ...@@ -491,7 +491,7 @@ public class PduPlayer {
/** Test execution for debugging /** Test execution for debugging
* @param args command-line arguments (unused) * @param args command-line arguments (unused)
*/ */
public static void main(String[] args) throws IOException // TODO fix exception handling public static void main(String[] args)
{ {
String DEFAULT_OUTPUT_DIRECTORY = "pduLog"; String DEFAULT_OUTPUT_DIRECTORY = "pduLog";
/** Default multicast group address we send on. /** Default multicast group address we send on.
...@@ -504,9 +504,16 @@ public class PduPlayer { ...@@ -504,9 +504,16 @@ public class PduPlayer {
int multicastPort = DEFAULT_MULTICAST_PORT; int multicastPort = DEFAULT_MULTICAST_PORT;
boolean sendToNet = true; boolean sendToNet = true;
// create instance of class in this static block try
PduPlayer pduPlayer = new PduPlayer(multicastAddress, multicastPort, Path.of(outputDirectory), sendToNet); {
// thread automatically starts up when class is instantiated // create instance of class in this static block
pduPlayer.begin(); // default is self test through all logs in ancestor pduLog subdirectory PduPlayer pduPlayer = new PduPlayer(multicastAddress, multicastPort, Path.of(outputDirectory), sendToNet);
// thread automatically starts up when class is instantiated
pduPlayer.begin(); // default is self test through all logs in ancestor pduLog subdirectory
}
catch (IOException ioe)
{
System.out.println("PduPlayer exception in main(): " + ioe.getMessage());
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment