import java.net.*;
import java.io.*;

public class UCServerPool extends PoolServerBase {

  protected void doClientProcessing() {
     try {
       InputStream is=socket.getInputStream();
       OutputStream os=socket.getOutputStream();
       while (true) {
          char c=(char)is.read();
// end on Control+C or Control+D
	  if (c=='\003' || c=='\004') break;
          os.write(Character.toUpperCase(c));
          }
       socket.close();
       }
     catch (Exception e) {
       System.out.println(e);
       }
     }
  public static void main(String[] args) {
    int n = Integer.parseInt(args[0]);
    init(UCServerPool.class,10);
    System.out.println("Starting server on port " + n);
    startServer(n);

    }
  }

