live
RTSPRegisterSender.hh
Go to the documentation of this file.
1 /**********
2 This library is free software; you can redistribute it and/or modify it under
3 the terms of the GNU Lesser General Public License as published by the
4 Free Software Foundation; either version 3 of the License, or (at your
5 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6 
7 This library is distributed in the hope that it will be useful, but WITHOUT
8 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10 more details.
11 
12 You should have received a copy of the GNU Lesser General Public License
13 along with this library; if not, write to the Free Software Foundation, Inc.,
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 **********/
16 // "liveMedia"
17 // Copyright (c) 1996-2021 Live Networks, Inc. All rights reserved.
18 // Special objects which, when created, sends a custom RTSP "REGISTER" (or "DEREGISTER") command
19 // to a specified client.
20 // C++ header
21 
22 #ifndef _RTSP_REGISTER_SENDER_HH
23 #define _RTSP_REGISTER_SENDER_HH
24 
25 #ifndef _RTSP_CLIENT_HH
26 #include "RTSPClient.hh"
27 #endif
28 
30 public:
32 protected: // we're a virtual base class
34  char const* remoteClientNameOrAddress, portNumBits remoteClientPortNum,
35  Authenticator* authenticator,
36  int verbosityLevel, char const* applicationName);
37 
38 public: // Some compilers complain if this is "protected:"
39  // A subclass of "RTSPClient::RequestRecord", specific to our "REGISTER" and "DEREGISTER" commands:
41  public:
42  RequestRecord_REGISTER_or_DEREGISTER(unsigned cseq, char const* cmdName, RTSPClient::responseHandler* rtspResponseHandler, char const* rtspURLToRegisterOrDeregister, char const* proxyURLSuffix);
44 
45  char const* proxyURLSuffix() const { return fProxyURLSuffix; }
46 
47  protected:
50  };
51 
52 protected:
54 };
55 
57 
59 public:
60  static RTSPRegisterSender*
62  char const* remoteClientNameOrAddress, portNumBits remoteClientPortNum, char const* rtspURLToRegister,
63  RTSPClient::responseHandler* rtspResponseHandler, Authenticator* authenticator = NULL,
64  Boolean requestStreamingViaTCP = False, char const* proxyURLSuffix = NULL, Boolean reuseConnection = False,
65  int verbosityLevel = 0, char const* applicationName = NULL);
66 
67  void grabConnection(int& sock, struct sockaddr_storage& remoteAddress); // so that the socket doesn't get closed when we're deleted
68 
69 protected:
71  char const* remoteClientNameOrAddress, portNumBits remoteClientPortNum, char const* rtspURLToRegister,
72  RTSPClient::responseHandler* rtspResponseHandler, Authenticator* authenticator,
73  Boolean requestStreamingViaTCP, char const* proxyURLSuffix, Boolean reuseConnection,
74  int verbosityLevel, char const* applicationName);
75  // called only by "createNew()"
77 
78  // Redefined virtual functions:
80  char*& cmdURL, Boolean& cmdURLWasAllocated,
81  char const*& protocolStr,
82  char*& extraHeaders, Boolean& extraHeadersWereAllocated);
83 
84 public: // Some compilers complain if this is "protected:"
85  // A subclass of "RequestRecord_REGISTER_or_DEREGISTER", specific to our "REGISTER" command:
87  public:
88  RequestRecord_REGISTER(unsigned cseq, RTSPClient::responseHandler* rtspResponseHandler, char const* rtspURLToRegister,
91 
92  char const* rtspURLToRegister() const { return fRTSPURLToRegisterOrDeregister; }
95 
96  private:
98  };
99 };
100 
102 
104 public:
105  static RTSPDeregisterSender*
107  char const* remoteClientNameOrAddress, portNumBits remoteClientPortNum, char const* rtspURLToDeregister,
108  RTSPClient::responseHandler* rtspResponseHandler, Authenticator* authenticator = NULL,
109  char const* proxyURLSuffix = NULL,
110  int verbosityLevel = 0, char const* applicationName = NULL);
111 
112 protected:
114  char const* remoteClientNameOrAddress, portNumBits remoteClientPortNum, char const* rtspURLToDeregister,
115  RTSPClient::responseHandler* rtspResponseHandler, Authenticator* authenticator,
116  char const* proxyURLSuffix,
117  int verbosityLevel, char const* applicationName);
118  // called only by "createNew()"
120 
121  // Redefined virtual functions:
123  char*& cmdURL, Boolean& cmdURLWasAllocated,
124  char const*& protocolStr,
125  char*& extraHeaders, Boolean& extraHeadersWereAllocated);
126 
127 public: // Some compilers complain if this is "protected:"
128  // A subclass of "RequestRecord_REGISTER_or_DEREGISTER", specific to our "DEREGISTER" command:
130  public:
131  RequestRecord_DEREGISTER(unsigned cseq, RTSPClient::responseHandler* rtspResponseHandler, char const* rtspURLToDeregister, char const* proxyURLSuffix);
133 
134  char const* rtspURLToDeregister() const { return fRTSPURLToRegisterOrDeregister; }
135  };
136 };
137 
138 #endif
const Boolean False
Definition: Boolean.hh:28
unsigned char Boolean
Definition: Boolean.hh:25
u_int16_t portNumBits
Definition: NetAddress.hh:102
#define NULL
void() responseHandler(RTSPClient *rtspClient, int resultCode, char *resultString)
Definition: RTSPClient.hh:55
RequestRecord_DEREGISTER(unsigned cseq, RTSPClient::responseHandler *rtspResponseHandler, char const *rtspURLToDeregister, char const *proxyURLSuffix)
virtual Boolean setRequestFields(RequestRecord *request, char *&cmdURL, Boolean &cmdURLWasAllocated, char const *&protocolStr, char *&extraHeaders, Boolean &extraHeadersWereAllocated)
static RTSPDeregisterSender * createNew(UsageEnvironment &env, char const *remoteClientNameOrAddress, portNumBits remoteClientPortNum, char const *rtspURLToDeregister, RTSPClient::responseHandler *rtspResponseHandler, Authenticator *authenticator=NULL, char const *proxyURLSuffix=NULL, int verbosityLevel=0, char const *applicationName=NULL)
RTSPDeregisterSender(UsageEnvironment &env, char const *remoteClientNameOrAddress, portNumBits remoteClientPortNum, char const *rtspURLToDeregister, RTSPClient::responseHandler *rtspResponseHandler, Authenticator *authenticator, char const *proxyURLSuffix, int verbosityLevel, char const *applicationName)
virtual ~RTSPDeregisterSender()
RequestRecord_REGISTER_or_DEREGISTER(unsigned cseq, char const *cmdName, RTSPClient::responseHandler *rtspResponseHandler, char const *rtspURLToRegisterOrDeregister, char const *proxyURLSuffix)
RTSPRegisterOrDeregisterSender(UsageEnvironment &env, char const *remoteClientNameOrAddress, portNumBits remoteClientPortNum, Authenticator *authenticator, int verbosityLevel, char const *applicationName)
RequestRecord_REGISTER(unsigned cseq, RTSPClient::responseHandler *rtspResponseHandler, char const *rtspURLToRegister, Boolean reuseConnection, Boolean requestStreamingViaTCP, char const *proxyURLSuffix)
static RTSPRegisterSender * createNew(UsageEnvironment &env, char const *remoteClientNameOrAddress, portNumBits remoteClientPortNum, char const *rtspURLToRegister, RTSPClient::responseHandler *rtspResponseHandler, Authenticator *authenticator=NULL, Boolean requestStreamingViaTCP=False, char const *proxyURLSuffix=NULL, Boolean reuseConnection=False, int verbosityLevel=0, char const *applicationName=NULL)
void grabConnection(int &sock, struct sockaddr_storage &remoteAddress)
virtual Boolean setRequestFields(RequestRecord *request, char *&cmdURL, Boolean &cmdURLWasAllocated, char const *&protocolStr, char *&extraHeaders, Boolean &extraHeadersWereAllocated)
RTSPRegisterSender(UsageEnvironment &env, char const *remoteClientNameOrAddress, portNumBits remoteClientPortNum, char const *rtspURLToRegister, RTSPClient::responseHandler *rtspResponseHandler, Authenticator *authenticator, Boolean requestStreamingViaTCP, char const *proxyURLSuffix, Boolean reuseConnection, int verbosityLevel, char const *applicationName)
virtual ~RTSPRegisterSender()