public void run( ) {
			try {
				selector = SelectorProvider.provider( ).openSelector( );

				/* more information on selectors and how to use them http://tutorials.jenkov.com/java-nio/selectors.html */

				/* Create non-blocking server socket. */
				channel = ServerSocketChannel.open( );

				channel.configureBlocking( false );

				/* Bind the server socket to Localhost */
				InetSocketAddress isa;
				if ( ip != null ) {
					isa = new InetSocketAddress( ip , port );
				} else {
					isa = new InetSocketAddress( InetAddress.getLocalHost( ) , port );
				}
				channel.socket( ).bind( isa );

				/* Register the socket for select events. */
				SelectionKey acceptKey = channel.register( selector , SelectionKey.OP_ACCEPT );

				LOGGER.info( "Starting server at " + isa );

				/* Loop forever. */
				for ( ; ; ) {

					selector.select( );
					Set< SelectionKey > readyKeys = selector.selectedKeys( );
					Iterator< SelectionKey > i = readyKeys.iterator( );

					while ( i.hasNext( ) ) {
						SelectionKey sk = ( SelectionKey ) i.next( );
						i.remove( );
						if ( sk.isAcceptable( ) ) {
							doAccept( sk );
						}
						if ( sk.isValid( ) && sk.isReadable( ) ) {
							doRead( sk );
						}
						if ( sk.isValid( ) && sk.isWritable( ) ) {
							doWrite( sk );
						}
					}
				}
			} catch ( Exception e ) {
				System.out.println( e );
			}

		}