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(); } }
public void connectTcp(InetSocketAddress address, IProtocol protocol) throws IOException { if (address == null) throw new IOException("アドレスエラー"); tcpClient.connect(address, ProtocolConstants.TIMEOUT, protocol); }