public void servive() throws IOException
	{
		ssc.register(selector, SelectionKey.OP_ACCEPT);
		while(selector.select()>0)
		{
			Set readykeys = selector.selectedKeys();
			Iterator iterator = readykeys.iterator();
			while(iterator.hasNext())
			{
				SelectionKey key = null;
				try {
					key = (SelectionKey) iterator.next();
					iterator.remove();
					if(key.isAcceptable())
					{
						ServerSocketChannel serverSocketChannel = (ServerSocketChannel)key.channel();
						SocketChannel socketChannel = serverSocketChannel.accept();
						socketChannel.configureBlocking(false);
						Socket socket = socketChannel.socket();
						System.out.println("connect"+socket.getInetAddress()+":"+socket.getPort());
						ByteBuffer buff = ByteBuffer.allocate(1024);
						//register the read and write event and carry a buff to store the data from Client
						socketChannel.register(selector, SelectionKey.OP_READ|SelectionKey.OP_WRITE,buff);
					}
					if(key.isReadable())
					{
						DebugLog.log("reading");
						receive(key);
					}
					if(key.isWritable())
					{
						//send(key);
					}
				} catch (IOException e) {
					e.printStackTrace();
					try {
						if(key!=null)
						{
							key.cancel();
							key.channel().close();
						}
					} catch (Exception e2) {
						e.printStackTrace();
					}
				} 
				
			}
		}
	}