public void init() throws IOException {
		ServerSocketChannel channel = ServerSocketChannel.open(); //Creates an unbound ServerSocketChannel
		
		System.out.println("Server Launched!");
		//Bind the channel to an address. The channel starts listening to incoming connections
		channel.bind(new InetSocketAddress(host, port));
		
		//Mark the ServerSocketChannel as non blocking
		channel.configureBlocking(false);
		
		//Creates a selector that will be used for multiplexing(?). The selector registers the ServerSocketChannel as
		//well as all SocketChannel's that are created
		Selector selector = Selector.open();
		
		//Registers the ServerSocketChannel with the selector. The OP_ACCEPT option marks a selection key as ready when
		//the channel accepts a new connection. When the ServerSocket accepts a connection this key is added to the list
		//of selected keys of the selector. When asked for the selected keys, this key is returned and hence we know that
		//a new connection has been accepted
		SelectionKey socketServerSelectionKey = channel.register(selector, SelectionKey.OP_ACCEPT);
		
		//Set property in the key that identifies the channel
		Map<String, String> properties = new HashMap<String, String>();
		properties.put(channelType, serverChannel);
		socketServerSelectionKey.attach(properties);
		
		//Wait for the selected keys
		for(;;) {
			//The select method is a blocking method which returns when at least one of the registered channels is selected
			//In this example, when the socket accepts a new connection, this method will return. Once a SocketClient 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. It is also possible to perform a nonblocking select using the selectNow() function. We can also
			//specify the maximum time for which a select function can be blocked using the select(long timeout) function
			if(selector.select() == 0) {
				continue; //start from the beginning of the loop again
			}
			
			//The select method returns with a list of selected keys
			Set<SelectionKey> selectedKeys = selector.selectedKeys();
			Iterator<SelectionKey> iterator = selectedKeys.iterator();
			
			while(iterator.hasNext()) {
				SelectionKey key = iterator.next();
				
				//The selection key could either be the ServerSocket informing that a new connection has been made, or a socket
				//client that is ready for read/write
				
				//We use the properties object attached to the channel to find out the type of channel
				if(((Map) key.attachment()).get(channelType).equals(serverChannel)) {
					//A new connection has been obtained. This channel is therefor a ServerSocket
					ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel();
					System.out.println("New connection obtained");
					
					//Accepts the new connection on the ServerSocket. Since the server socket channel is marked as non-block, this
					//channel will return null if no client is connected
					SocketChannel clientSocketChannel = serverSocketChannel.accept();
					
					if(clientSocketChannel != null) {
						System.out.println("Client Connected!");
						
						//Set the client connection to be non-blocking
						clientSocketChannel.configureBlocking(false);
						SelectionKey clientKey = clientSocketChannel.register(selector, SelectionKey.OP_READ, SelectionKey.OP_WRITE);
						Map<String, String> clientProperties = new HashMap<String, String>();
						clientProperties.put(channelType, clientChannel);
						clientKey.attach(clientProperties);
						
						//Write something to the new created client
						CharBuffer buffer = CharBuffer.wrap("Hello Client");
						while(buffer.hasRemaining()) {
							clientSocketChannel.write(Charset.defaultCharset().encode(buffer));
						}
						
						buffer.clear();
					}
				} else { //Data is available for read
					//Buffer for reading
					ByteBuffer buffer = ByteBuffer.allocate(20);
					SocketChannel clientChannel = (SocketChannel) key.channel();
					int bytesRead = 0;
					if(key.isReadable()) {
						//The channel is non-blocking, so keep it open till the count is >=0
						if((bytesRead - clientChannel.read(buffer)) > 0) {
							buffer.flip();
							
							System.out.println(Charset.defaultCharset().decode(buffer));
							buffer.clear();
						}
						
						if(bytesRead < 0) {
							//They key is automatiicaly invalidated once the channel is closed
							clientChannel.close();
						}
					}
				}
				
				//Once a key is handled, it needs to be removed
				iterator.remove();
			}
		}
	}