public void communicate() throws IOException {

		new Thread(new Runnable() {
			public void run() {
				try {
					String str = sbr.readLine();
					while (str != null) {
						System.out.println(str);
						str = sbr.readLine();
					}
					System.err.println("Disconnected by server");
				} catch (IOException e) {
					System.err.println(e);
				} finally {
					try {
						socket.close();
					} catch (IOException e) {
						e.printStackTrace();
					}
					System.exit(0);
				}
			}
		}).start();

	
		String str = br.readLine();
		while (str != null) {// C-d
			spw.println(str);
			str = br.readLine();
		}
		System.out.println("Disconnected by client");
		socket.close();
		System.exit(0);
	}