bool SocksStreams::appendLocalConnection(const QString &AKey)
{
	if (!AKey.isEmpty() && !FLocalKeys.contains(AKey))
	{
		if (FServer.isListening() || FServer.listen(QHostAddress::Any, listeningPort()))
		{
			FLocalKeys.append(AKey);
			return true;
		}
		else if (!FServer.isListening())
		{
			LOG_ERROR(QString("Failed to append local socks connection, port=%1: %2").arg(listeningPort()).arg(FServer.errorString()));
		}
	}
	else if (AKey.isEmpty())
	{
		REPORT_ERROR("Failed to append local socks connection: Key is empty");
	}
	return false;
}
Beispiel #2
0
retCode setupDebugChannels() {
  if (debuggerPort > 0 && debugInChnnl == Null) {
    if (debuggerListener == Null) {
      debuggerListener = listeningPort("star-debug", debuggerPort);
      showPkgFile = True;

      retCode ret = acceptConnection(debuggerListener, utf8Encoding, &debugInChnnl, &debugOutChnnl);
      if (ret != Ok) {
        syserr("fatal problem in establishing debugger connection");
      }
      return ret;
    }
  } else if (debugInChnnl == Null) {
    debugInChnnl = Stdin();
    debugOutChnnl = Stdout();
    return Ok;
  }
  return Error;
}