--- projects/cms/source/host/java/LowLevelNet.java 2000/11/27 20:36:24 1.2 +++ projects/cms/source/host/java/LowLevelNet.java 2000/12/07 23:20:35 1.4 @@ -3,13 +3,14 @@ //---IMPORTS--- import java.net.*; +import java.io.*; /** * Provides low level network functions for JavaHost * * - * @author $Author: ab11 $ - * @version $Id: LowLevelNet.java,v 1.2 2000/11/27 20:36:24 ab11 Exp $ + * @author $Author: tdb $ + * @version $Id: LowLevelNet.java,v 1.4 2000/12/07 23:20:35 tdb Exp $ */ class LowLevelNet { @@ -24,14 +25,19 @@ class LowLevelNet { public static void sendUDPPacket( Config config, String inText ){ if ( inText.length() != 0 ){ - + System.out.println("SENT: "+inText); // will throw an exception if an error occurs, so must bung it in a try - // try { + try { DatagramPacket udp = new DatagramPacket( inText.getBytes(), inText.length(), config.getFilterName(), config.getFilterUDPPort() ); - // } - //catch ( UnknownHostException e ){ - // the serverName supplied could not be resolved using dns - // } + DatagramSocket sendSoc = new DatagramSocket(); + sendSoc.send(udp); + } + catch ( SocketException e ){ + // the serverName supplied could not be resolved using dns + } + catch ( IOException e ){ + // problem sending.. + } } }