类 RemoteServer

    • 方法详细资料

      • getSelector

        @Contract(pure=true)
        public Selector getSelector()
      • select

        public void select()
                    throws IOException
        Waiting for connected data and processing it

        Please execute this method in a new thread, or execute it in ExecutorService

        
         RemoteServer server = new RemoteServer();
         server.getServer().socket().bind(new InetSocketAddress(23333));
         new Thread(()->{
              while(server.isOpen()){
                  try{
                      server.select();
                  } catch (IOException ignore){}
              }
         }).start();
        抛出:
        IOException - IOException
      • isOpen

        public boolean isOpen()