import java.net.*;
import java.io.*;

public class ServerUsingURLConnection {

	public static void main(String[] args) {
		try {
			ServerSocket ss = new ServerSocket(8088);
			Socket s = ss.accept();
			System.out.println("after accpet");
			InputStream inputStream = s.getInputStream();
			byte[] msg = new byte[100];
			for (int i=0;i<100;i++) {
				msg[i]=(byte)inputStream.read();
				System.out.println("msg["+i+"] : "+msg[i]);
			}
			System.out.println("msg : "+new String(msg));
		} catch(Exception e) {
			e.printStackTrace();
			System.out.println("an exception occurred!");
		}
	}
}