ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/XMLReader/UDPReader.java
(Generate patch)

Comparing experimental/server/XMLReader/UDPReader.java (file contents):
Revision 1.6 by pjm2, Tue Nov 21 09:15:06 2000 UTC vs.
Revision 1.8 by pjm2, Tue Nov 21 10:11:21 2000 UTC

# Line 26 | Line 26 | public class UDPReader extends Thread{
26              socket = new DatagramSocket(port);
27          }
28          catch (BindException e){
29 <            System.out.println("Some other process is already listening on port "+port+".");
30 <            System.out.println("Please specify another port number on the command line.");
29 >            logger.write(this.toString(), Logger.SYSMSG, "Could not start the UDPReader thread on port "+port+" as this port was already in use.");
30              return;
31          }
32          catch (Exception e){
33 <            System.out.println("An exception occured while creating the DatagramSocket.");
33 >            logger.write(this.toString(), Logger.SYSMSG, "Could not start the UDPReader thread on port "+port+".");
34              return;
35          }
36          
37 <        System.out.println("UDPReader ready and listening for UDP packets on port "+port);
37 >        logger.write(this.toString(), Logger.SYSMSG, "UDPReader thread ready and listening for UDP packets on port "+port);
38  
39          byte[] buf;
41        UDPReaderThread t = new UDPReaderThread();
40          
41          boolean running = true;
42          while (running){
# Line 47 | Line 45 | public class UDPReader extends Thread{
45                  // receive request
46                  DatagramPacket packet = new DatagramPacket(buf, buf.length);
47                  socket.receive(packet);
48 +                UDPReaderThread t = new UDPReaderThread();
49                  t.run(packet);
50              }
51              catch (IOException e) {
52 <                System.out.println("An exception occured in the UDPReader!");
53 <                e.printStackTrace();
52 >                logger.write(this.toString(), Logger.SYSMSG, "The UDPReader thread has been shut down as an exception occured: "+e);
53 >                return;
54              }
55          }
56          socket.close();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines