public void init() throws IOException {
		ServerSocketChannel channel = ServerSocketChannel.open();
		
		channel.bind(new InetSocketAddress(host, port));
		channel.configureBlocking(false);
		
		System.out.println("Server Launched!");
		
		//Creates a selector that will be used for multiplexing
		//Registers the ServerSocketChannel as well as the SocketChannels that are created
		Selector selector = Selector.open();
		
		SelectionKey socketServerSelectionKey = channel.register(selector, SelectionKey.OP_ACCEPT);
		
		Map<String, String> properties = new HashMap<String, String>();
		properties.put(channelType, serverChannel);
		socketServerSelectionKey.attach(properties);
		
		while(true) { //ifs, for checking if there is something to read
			//When the socket accepts a new connection, this method will return.
			//Once a socket-client is added to the list of registered channels, then this method would
			//also return when one of the clients has data to be read or written
			
			if(selector.select() == 0)
				continue; //nothing to do
			
			Iterator<SelectionKey> iterator = selector.selectedKeys().iterator();
			
			while(iterator.hasNext()) {
				SelectionKey key = iterator.next();
				
				//Only ServerSockets have the interest OP_ACCEPT, so we know its not a Socket-Client
				if(key.isAcceptable()) {
					ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel();
					SocketChannel clientSocketChannel = serverSocketChannel.accept();
					count++;
					
					if(clientSocketChannel != null) {
						//Set the client connection to be nonblocking
						clientSocketChannel.configureBlocking(false);
						clientSocketChannel.register(selector, SelectionKey.OP_READ, SelectionKey.OP_WRITE);
						
						CharBuffer writeBuffer = CharBuffer.wrap("hello client");
						while(writeBuffer.hasRemaining()) {
							clientSocketChannel.write(Charset.defaultCharset().encode(writeBuffer));
						}
						
						writeBuffer.clear();
					}
				} else {
					ByteBuffer readBuffer = ByteBuffer.allocate(20);
					SocketChannel clientChannel = (SocketChannel) key.channel();
					int bytesRead;
					
					if(key.isReadable()) {
						if((bytesRead = clientChannel.read(readBuffer)) > 0) {
							readBuffer.flip();
							System.out.print(Charset.defaultCharset().decode(readBuffer) + "\n");
							readBuffer.clear();
						}
						
						if(bytesRead < 0) {
							clientChannel.close();
						}
					}
				}
				
				iterator.remove();
			}
		}
	}