Revision: | 1.1 |
Committed: | Fri Nov 17 11:23:19 2000 UTC (24 years ago) by pjm2 |
Branch: | MAIN |
Log Message: | The UDPReader class contains a main method for running on a machine to accept the UDP XML data coming in. Once it receives something, it passes it on to a separate UDPReaderThread class to try and prevent the loss of packets. |
# | Content |
---|---|
1 | import java.io.*; |
2 | import java.net.*; |
3 | import java.util.*; |
4 | |
5 | public class UDPReaderThread extends Thread{ |
6 | |
7 | public UDPReaderThread(DatagramPacket packet){ |
8 | try { |
9 | xml = new String(packet.getData()); |
10 | } |
11 | catch (Exception e) { |
12 | System.out.println("An exception occured while attempting to return an XMLPacket!"); |
13 | e.printStackTrace(); |
14 | } |
15 | } |
16 | |
17 | public void run(){ |
18 | XMLPacketMaker xmlPacketMaker = new XMLPacketMaker(xml); |
19 | XMLPacket packet = xmlPacketMaker.createXMLPacket(); |
20 | } |
21 | |
22 | String xml; |
23 | } |