package test;

import java.io.PrintStream;
import java.net.Socket;
import java.util.Date;

public class ConnectionHandler extends Thread {
	Socket socket;
	ConnectionHandler(Socket s){
		socket = s;
	}
	public void run(){
		System.out.println("Server local port:" + socket.getLocalPort());
		try{
			PrintStream p = new PrintStream(socket.getOutputStream());
			p.println(new Date());
			Thread.sleep(15000);
			socket.close();
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
