diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-10-04 12:52:55 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-10-04 12:52:55 -0500 |
commit | 379f344bb31b16b7800442c86bd925ea47b99fa4 (patch) | |
tree | 10ad38bc2cadc40d3f19d7dd1d75cbd370ed7689 /tdecore/ksock.h | |
parent | 319f69a280df213c70a2bf18d999d29641d45fc7 (diff) | |
download | tdelibs-379f344bb31b16b7800442c86bd925ea47b99fa4.tar.gz tdelibs-379f344bb31b16b7800442c86bd925ea47b99fa4.zip |
Modify bindAndListen to allow suppression of warnings when bind failures are expected as part of normal operation
This relates to Bug 1988
Diffstat (limited to 'tdecore/ksock.h')
-rw-r--r-- | tdecore/ksock.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tdecore/ksock.h b/tdecore/ksock.h index cdf4ad1ac..422e69b9b 100644 --- a/tdecore/ksock.h +++ b/tdecore/ksock.h @@ -282,9 +282,12 @@ public: * Binds the socket and start listening. This should only be called * once when the constructor was called with _bind false. * On error the socket will be closed. + * @param suppressFailureMessages suppress warning messages generated if the socket cannot be opened. * @return true on success. false on error. + * @warning If suppressFailureMessages is TRUE future debugging may be made more difficult. Only set it + * if your application expects to bind to unavailable ports, e.g. while scanning for open ports in a range. */ - bool bindAndListen(); + bool bindAndListen(bool suppressFailureMessages = false); /** * Returns the file descriptor associated with the socket. @@ -339,6 +342,11 @@ protected: int sock; private: + // DEPRECATED +#ifdef KSOCK_INTERNAL_C_COMPILATION + KDE_EXPORT bool bindAndListen(); +#endif // KSOCK_INTERNAL_C_COMPILATION + TDEServerSocket(const TDEServerSocket&); TDEServerSocket& operator=(const TDEServerSocket&); |