From a9fe8f28a4a9aaf1d9b84dbc6907849ace87f66e Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Tue, 6 Feb 2001 01:01:46 +0000 Subject: - Added KDE2 PropsDialog Plugin (incomplete) - Fixed some KDE related autoconf stuff - Added PlpDrive class for returning results from rfsv:devinfo - Added auto-watch in ppsocket and finally got rid of the nasty SIGPIPE bug. Now it's no more necessary to ignore SIGPIPE in applications. - Made constructors of rfsv16, rfsv32, rpcs16 and rpcs32 private to enforce use of the factories. - Removed error output in the factories and replaced that by error codes which can be retrieved and evaluated by an application. --- lib/ppsocket.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'lib/ppsocket.h') diff --git a/lib/ppsocket.h b/lib/ppsocket.h index 57cc788..b8f7ebe 100644 --- a/lib/ppsocket.h +++ b/lib/ppsocket.h @@ -8,6 +8,7 @@ #include class bufferStore; +class IOWatch; /** * A class for dealing with sockets. @@ -80,11 +81,14 @@ public: ppsocket *accept(string *Peer); /** - * Check for incoming data. + * Check and optionally wait for incoming data. + * + * @param sec Timeout in seconds + * @param usec Timeout in microseconds * * @returns true if data is available, false otherwise. */ - bool dataToGet() const; + bool dataToGet(int sec, int usec) const; /** * Receive data into a @ref bufferStore . @@ -169,11 +173,13 @@ public: bool getHost(string *Host, int *Port); /** - * Retrieves the socket number. + * Registers an @ref IOWatch for this socket. + * This IOWatch gets the socket added/removed + * automatically. * - * @returns the socket number. + * @param watch The IOWatch to register. */ - inline int socket(void) const { return(m_Socket); } + void setWatch(IOWatch *watch); private: /** @@ -193,6 +199,7 @@ public: int m_Port; bool m_Bound; int m_LastError; + IOWatch *myWatch; }; #endif -- cgit v1.2.3