summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorschmirl <schmirl>2007-04-24 10:57:34 +0000
committerschmirl <schmirl>2007-04-24 10:57:34 +0000
commitac4c391c43f993f51ff8f34eaf9eec7e15166fb8 (patch)
treee44df569bd957dabda00fb23b88def5c96a41349 /client
parent2a4370b6a00f370b05e311478b693d90e19ce7c9 (diff)
downloadvdr-plugin-streamdev-ac4c391c43f993f51ff8f34eaf9eec7e15166fb8.tar.gz
vdr-plugin-streamdev-ac4c391c43f993f51ff8f34eaf9eec7e15166fb8.tar.bz2
client_socket-close_data_connection.patch by Petri Hintukainen
- Add member function to close data connection Modified Files: client/socket.c client/socket.h
Diffstat (limited to 'client')
-rw-r--r--client/socket.c20
-rw-r--r--client/socket.h3
2 files changed, 21 insertions, 2 deletions
diff --git a/client/socket.c b/client/socket.c
index e59c705..5db6efe 100644
--- a/client/socket.c
+++ b/client/socket.c
@@ -1,5 +1,5 @@
/*
- * $Id: socket.c,v 1.7 2007/01/15 11:45:48 schmirl Exp $
+ * $Id: socket.c,v 1.8 2007/04/24 10:57:34 schmirl Exp $
*/
#include <tools/select.h>
@@ -215,6 +215,24 @@ bool cClientSocket::CreateDataConnection(eSocketId Id) {
return true;
}
+bool cClientSocket::CloseDataConnection(eSocketId Id) {
+ //if (!CheckConnection()) return false;
+
+ CMD_LOCK;
+
+ if(Id == siLive || Id == siLiveFilter)
+ if (m_DataSockets[Id] != NULL) {
+ std::string command = (std::string)"ABRT " + (const char*)itoa(Id);
+ if (!Command(command, 220)) {
+ if (errno == 0)
+ esyslog("ERROR: Streamdev: Couldn't cleanly close data connection");
+ //return false;
+ }
+ DELETENULL(m_DataSockets[Id]);
+ }
+ return true;
+}
+
bool cClientSocket::SetChannelDevice(const cChannel *Channel) {
if (!CheckConnection()) return false;
diff --git a/client/socket.h b/client/socket.h
index 17478ce..e839223 100644
--- a/client/socket.h
+++ b/client/socket.h
@@ -1,5 +1,5 @@
/*
- * $Id: socket.h,v 1.3 2005/02/08 17:22:35 lordjaxom Exp $
+ * $Id: socket.h,v 1.4 2007/04/24 10:57:34 schmirl Exp $
*/
#ifndef VDR_STREAMDEV_CLIENT_CONNECTION_H
@@ -47,6 +47,7 @@ public:
bool CheckConnection(void);
bool ProvidesChannel(const cChannel *Channel, int Priority);
bool CreateDataConnection(eSocketId Id);
+ bool CloseDataConnection(eSocketId Id);
bool SetChannelDevice(const cChannel *Channel);
bool SetPid(int Pid, bool On);
#if VDRVERSNUM >= 10300