Пример #1
0
  private void startEventLoop() {
    while (isRunning) {
      if (!SwtUtils.DISPLAY.readAndDispatch()) {
        SwtUtils.DISPLAY.sleep();
      }
    }
    try {
      SwtUtils.DISPLAY.dispose();
    } catch (RuntimeException e) {
    }

    tcpClient.dispose();
    udpClient.dispose();

    try {
      executorService.shutdownNow();
    } catch (RuntimeException ex) {
    }

    try {
      iniSettingFile.saveToIni();
    } catch (IOException ex) {
      ex.printStackTrace();
    }
    try {
      iniAppDataFile.saveToIni();
    } catch (IOException ex) {
      ex.printStackTrace();
    }
  }
Пример #2
0
 public void connectUdp(InetSocketAddress address, IProtocol protocol) throws IOException {
   if (address == null) throw new IOException("アドレスエラー");
   udpClient.connect(address, ProtocolConstants.TIMEOUT, protocol);
 }