private void startService(Map<String, Object> port_props) {
    if (port_props == null) {
      throw new NullPointerException("port_props cannot be null.");
    }

    ConnectionListenerImpl cli = new ConnectionListenerImpl(port_props);

    if (cli.getConnectionType() == ConnectionType.accept) {
      pending_open.add(cli);
    }
    connectThread.addConnectionOpenListener(cli);
  }
 private void releaseListeners() {
   for (ConnectionListenerImpl cli : pending_open) {
     connectThread.removeConnectionOpenListener(cli);
   }
   pending_open.clear();
 }