public void init() throws IOException, InterruptedException {
		Scanner scanner = new Scanner(System.in);
		
		SocketChannel channel = SocketChannel.open();
		
		channel.configureBlocking(false);
		channel.connect(new InetSocketAddress(host, port));
		
		while(!channel.finishConnect()) {
			
		}
		
		while(true) {
			//System.out.println("Loop");
			ByteBuffer readBuffer = ByteBuffer.allocate(20);
			int bytesRead = 0;
			String message = "";
			while((bytesRead = channel.read(readBuffer)) > 0) {
				readBuffer.flip();
				message += Charset.defaultCharset().decode(readBuffer); //Decodes bytes into Unicode characters
			}
			
			if(message.length() > 0) {
				System.out.println(message);
				message = "";
			}
			
			System.out.print("Enter a message :: ");
			CharBuffer writeBuffer = CharBuffer.wrap(scanner.next());
			while(writeBuffer.hasRemaining()) {
				channel.write(Charset.defaultCharset().encode(writeBuffer));
			}
		}
	}