public static void main(String[] args) throws Exception
	{
		
		Socket socket = new Socket("127.0.0.1",5001);
		
		OutputStream os = socket.getOutputStream();
		
		InputStream is = socket.getInputStream();
		
		os.write("hi ".getBytes());
		
		byte[] buffer = new byte[200];
		
		int length = 0;
		
		while(-1 != (length = is.read(buffer, 0, buffer.length)))
		{
			String str = new String(buffer,0,length);
			
			System.out.println(str);
		}
		
		is.close();
		os.close();
		socket.close();
	}