aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ppsocket.h
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2001-02-06 01:01:46 +0000
committerFritz Elfert <felfert@to.com>2001-02-06 01:01:46 +0000
commita9fe8f28a4a9aaf1d9b84dbc6907849ace87f66e (patch)
tree0dd290cdf04cfd17a4ab4d0eb86bcb48137a02cb /lib/ppsocket.h
parenta8787d39b2bf1851cdea64a5e0eccc2aff7f15de (diff)
downloadplptools-a9fe8f28a4a9aaf1d9b84dbc6907849ace87f66e.tar.gz
plptools-a9fe8f28a4a9aaf1d9b84dbc6907849ace87f66e.tar.bz2
plptools-a9fe8f28a4a9aaf1d9b84dbc6907849ace87f66e.zip
- 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.
Diffstat (limited to 'lib/ppsocket.h')
-rw-r--r--lib/ppsocket.h17
1 files changed, 12 insertions, 5 deletions
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 <arpa/inet.h>
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