diff options
author | Frank Schmirler <vdr@schmirler.de> | 2012-03-03 23:24:30 +0100 |
---|---|---|
committer | Frank Schmirler <vdr@schmirler.de> | 2012-03-03 23:39:30 +0100 |
commit | 3da6ae734e6b3caf6a02984688b8405db060df57 (patch) | |
tree | c09a55c3e994d548ce83815a78a0efeca8c56859 /client/socket.h | |
parent | c1dc1453c5e47b46a43a81e006ab34005b20526d (diff) | |
download | vdr-plugin-streamdev-3da6ae734e6b3caf6a02984688b8405db060df57.tar.gz vdr-plugin-streamdev-3da6ae734e6b3caf6a02984688b8405db060df57.tar.bz2 |
Timout for network operations now configurable in streamdev-client setup
Diffstat (limited to 'client/socket.h')
-rw-r--r-- | client/socket.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/client/socket.h b/client/socket.h index 42d7574..01d7a0f 100644 --- a/client/socket.h +++ b/client/socket.h @@ -8,6 +8,7 @@ #include <tools/socket.h> #include "common.h" +#include "client/setup.h" #include <string> @@ -21,22 +22,23 @@ private: cMutex m_Mutex; char m_Buffer[BUFSIZ + 1]; // various uses bool m_Prio; // server supports command PRIO + bool m_Abort; // quit command pending time_t m_LastSignalUpdate; int m_LastSignalStrength; int m_LastSignalQuality; protected: /* Send Command, and return true if the command results in Expected. - Returns false on failure, setting errno appropriately if it has been - a system failure. If Expected is zero, returns immediately after - sending the command. */ - bool Command(const std::string &Command, uint Expected = 0, uint TimeoutMs = 1500); + Returns false on failure. */ + bool Command(const std::string &Command, uint Expected); - /* Fetch results from an ongoing Command called with Expected == 0. Returns - true if the response has the code Expected, returning an internal buffer - in the array pointer pointed to by Result. Returns false on failure, - setting errno appropriately if it has been a system failure. */ - bool Expect(uint Expected, std::string *Result = NULL, uint TimeoutMs = 1500); + /* Send the given command. Returns false on failure. */ + bool Send(const std::string &Command); + + /* Fetch results from an ongoing Command. The status code and the + buffer holding the server's response are stored in Code and Result + if non-NULL. Returns false on failure. */ + bool Receive(const std::string &Command, uint *Code = NULL, std::string *Result = NULL, uint TimeoutMs = StreamdevClientSetup.Timeout * 1000); public: cClientSocket(void); |