summaryrefslogtreecommitdiff
path: root/libs/networking/include
diff options
context:
space:
mode:
Diffstat (limited to 'libs/networking/include')
-rw-r--r--libs/networking/include/AbstractSocket.h20
-rw-r--r--libs/networking/include/ServerConfig.h13
-rw-r--r--libs/networking/include/ServerSocket.h16
3 files changed, 26 insertions, 23 deletions
diff --git a/libs/networking/include/AbstractSocket.h b/libs/networking/include/AbstractSocket.h
index ff76f52..98e77f7 100644
--- a/libs/networking/include/AbstractSocket.h
+++ b/libs/networking/include/AbstractSocket.h
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
- *
+ *
* File: AbstractSocket.h
* Created: 4. Juli 2012, 07:13
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
* Project: libnetworking: classes for tcp/ip sockets and http-protocol handling
- *
+ *
* CMP - compound media player
- *
+ *
* is a client/server mediaplayer intended to play any media from any workstation
* without the need to export or mount shares. cmps is an easy to use backend
* with a (ready to use) HTML-interface. Additionally the backend supports
* authentication via HTTP-digest authorization.
* cmpc is a client with vdr-like osd-menues.
- *
+ *
* Copyright (c) 2012 Reinhard Mantey, some rights reserved!
* published under Creative Commons by-sa
* For details see http://creativecommons.org/licenses/by-sa/3.0/
- *
+ *
* The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
- *
+ *
* --------------------------------------------------------------
*/
#ifndef ABSTRACTSOCKET_H
@@ -40,13 +40,13 @@ public:
protected:
cAbstractSocket(int Port, int Queue = 1);
cAbstractSocket(const char *ServerName, int Port);
- bool Connect();
- bool Open(int Port);
- cConnectionPoint *Accept(int Port, int TimeoutMs = -1);
bool ForceBlockingIO(void) const { return blocking; }
void SetBlockingIO(bool ForceBlockingIO = true);
cConnectionPoint *GetNameAndAddress(int Socket, struct sockaddr *sa, socklen_t sa_size);
- void Close(void);
+ virtual cConnectionPoint *Accept(int Port, int TimeoutMs = -1);
+ virtual bool Connect();
+ virtual bool Open(int Port);
+ virtual void Close(void);
private:
int sock;
diff --git a/libs/networking/include/ServerConfig.h b/libs/networking/include/ServerConfig.h
index f64b5f5..c61c896 100644
--- a/libs/networking/include/ServerConfig.h
+++ b/libs/networking/include/ServerConfig.h
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
- *
+ *
* File: ServerConfig.h
* Created: 8. Juli 2012, 06:12
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
* Project: libnetworking: classes for tcp/ip sockets and http-protocol handling
- *
+ *
* CMP - compound media player
- *
+ *
* is a client/server mediaplayer intended to play any media from any workstation
* without the need to export or mount shares. cmps is an easy to use backend
* with a (ready to use) HTML-interface. Additionally the backend supports
* authentication via HTTP-digest authorization.
* cmpc is a client with vdr-like osd-menues.
- *
+ *
* Copyright (c) 2012 Reinhard Mantey, some rights reserved!
* published under Creative Commons by-sa
* For details see http://creativecommons.org/licenses/by-sa/3.0/
- *
+ *
* The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
- *
+ *
* --------------------------------------------------------------
*/
#ifndef SERVERCONFIG_H
@@ -41,6 +41,7 @@ public:
void SetAppIcon(const char *AppIcon);
void SetAuthorizationRequired(bool Authorize) { authorizationRequired = Authorize; }
void SetDocumentRoot(const char *DocumentRoot);
+ void SetPort(int port);
private:
cServerSocket server;
diff --git a/libs/networking/include/ServerSocket.h b/libs/networking/include/ServerSocket.h
index 2fc17fb..9465d67 100644
--- a/libs/networking/include/ServerSocket.h
+++ b/libs/networking/include/ServerSocket.h
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
- *
+ *
* File: ServerSocket.h
* Created: 4. Juli 2012, 07:28
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
* Project: libnetworking: classes for tcp/ip sockets and http-protocol handling
- *
+ *
* CMP - compound media player
- *
+ *
* is a client/server mediaplayer intended to play any media from any workstation
* without the need to export or mount shares. cmps is an easy to use backend
* with a (ready to use) HTML-interface. Additionally the backend supports
* authentication via HTTP-digest authorization.
* cmpc is a client with vdr-like osd-menues.
- *
+ *
* Copyright (c) 2012 Reinhard Mantey, some rights reserved!
* published under Creative Commons by-sa
* For details see http://creativecommons.org/licenses/by-sa/3.0/
- *
+ *
* The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp
- *
+ *
* --------------------------------------------------------------
*/
#ifndef SERVERSOCKET_H
@@ -31,11 +31,13 @@ class cServerSocket : public cAbstractSocket {
public:
cServerSocket(int Port, int Queue = 1);
virtual ~cServerSocket();
- bool Open(void);
+ virtual bool Open(void);
+ virtual void Close(void);
bool Active(void) const { return active; }
void SetActive(bool Active = true) { active = Active; }
cConnectionPoint *Accept(void);
int Port(void) const { return port; }
+ void SetPort(int port);
int ReUseAddress(void) const;
void SetReUseAddress(int ReUse);
void ConfigureSocket(int Socket);