ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/XMLReader/XMLReader.java
Revision: 1.2
Committed: Fri Nov 17 14:50:54 2000 UTC (24 years ago) by pjm2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
State: FILE REMOVED
Log Message:
Removed XMLReader.java - Seemed more appropriate to call it UDPReader.

File Contents

# User Rev Content
1 pjm2 1.1 import java.io.*;
2     import java.net.*;
3     import java.util.*;
4    
5     public class XMLReader {
6    
7     public static void main(String[] args) throws IOException {
8    
9     DatagramSocket socket = new DatagramSocket(4589);
10    
11     try {
12     byte[] buf = new byte[1024];
13     // receive request
14     DatagramPacket packet = new DatagramPacket(buf, buf.length);
15     socket.receive(packet);
16     String dataIn = new String(packet.getData());
17     System.out.println("Received: " + dataIn);
18     }
19     catch (IOException e) {
20     System.out.println("An exception occured!");
21     e.printStackTrace();
22     }
23     socket.close();
24     }
25     }