[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] engine/netio/pub listenresp.h, 1.3,
From:       jgordon () helixcommunity ! org
Date:       2009-09-14 23:21:56
Message-ID: 200909150030.n8F0UvKL027117 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/netio/pub
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv24035/server/engine/netio/pub

Modified Files:
	listenresp.h 
Removed Files:
	http_listenresp.h mms_listenresp.h rtsp_listenresp.h 
Log Message:
Synopsis
========
Consolidate a bunch of code that is duplicated for every protocol.

Branches: HEAD (SERVER_CURRENT)
Suggested Reviewer: dcollins


Description
===========
A subclass of ListenResponse was defined for every listening protocol.
But they were all pretty much identical except for constants. Rather
than adding yet another copy, I am just moving everything into
ListenResponse and passing in constants, etc.

CoreProcInit had a bunch of blocks of near identical code where it
initialized the ListenResponse objects. This is now in one method
called for each protocol.

Fixed up the re-use ports hack. This was a hack to allow the various
HTTP protocols (FCS, etc.) to be configured to the same ports and the
same as HTTP. (It was just checking for an in-use error from the socket
and ignoring it for certain ports). Added a method IsRegistered to
HXProtocolManager to check whether the port is already registered as a
managed shared port protocol. This seems completely unrelated, but this
fix was needed for decent sharing of the CoreProcInit changes and was
easy since I was already all up in there.


Files Affected
==============
server/engine/core/core_proc.cpp
server/engine/core/hxprotmgr.cpp
server/engine/core/pub/core_proc.h
server/engine/core/pub/hxprot.h
server/engine/core/pub/hxprotmgr.h
server/engine/netio/Umakefil
server/engine/netio/listenresp.cpp
server/engine/netio/pub/listenresp.h
server/engine/netio/http_listenresp.cpp [removed]
server/engine/netio/mms_listenresp.cpp [removed]
server/engine/netio/rtsp_listenresp.cpp [removed]
server/engine/netio/pub/http_listenresp.h [removed]
server/engine/netio/pub/mms_listenresp.h [removed]
server/engine/netio/pub/rtsp_listenresp.h [removed]


Testing Performed
=================
Unit Tests:

Integration Tests:
Verified RTSP streaming and FCS switching with normal separate ports
Verified RTSP streaming and FCS switching with duplicate HTTP ports
Verified start-up failure with other ports duplicating the MMS port
Verified start-up failure with configured ports otherwise in use

Leak Tests:
None

Performance Tests:
None

Platforms Tested:linux-rhel5-i686
Build verified: linux-rhel5-i686, win32-i386-vc7,
sunos-5.10-sparc-server


QA Hints
===============
A new uptime should be run to verify no weird unexpected consequences.




Index: listenresp.h
===================================================================
RCS file: /cvsroot/server/engine/netio/pub/listenresp.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- listenresp.h	25 Jan 2005 22:55:21 -0000	1.3
+++ listenresp.h	14 Sep 2009 23:21:54 -0000	1.4
@@ -47,6 +47,7 @@
 #include "engine.h"
 #include "base_callback.h"
 #include "servsockimp.h"
+#include "hxprotmgr.h"
 
 class ServerRegistry;
 
@@ -57,6 +58,9 @@
     ListenResponse(Process* _proc);
     virtual ~ListenResponse(void);
 
+    HX_RESULT Init(UINT16 uPort, 
+                    HXProtocolType prot, 
+                    HXBOOL bShared);
     void Close(void);
 
     // IUnknown
@@ -74,15 +78,15 @@
     STDMETHOD(DeleteActiveProp) (THIS_ const char* pName,
                                        IHXActivePropUserResponse* pResponse);
 
-    // IHXListeningSocketResponse (must be overridden)
+    // IHXListeningSocketResponse
     STDMETHOD(OnConnection)         (THIS_ IHXSocket* ppNewSock,
-                                           IHXSockAddr* ppSource) PURE;
-    STDMETHOD(OnError)              (THIS_ HX_RESULT err) PURE;
+                                           IHXSockAddr* ppSource);
+    STDMETHOD(OnError)              (THIS_ HX_RESULT err);
 
 protected:
+    HX_RESULT InitAddress(UINT16 uPort, HXBOOL bShared);
     HX_RESULT InitSocket(UINT16 uPort);
 
-protected:
     INT32                       m_nRefCount;
     Process*                    m_pProc;
     IHXErrorMessages*           m_pMessages;
@@ -92,6 +96,7 @@
     IHXListeningSocket*         m_pSock;
 
     IHXBuffer*                  m_ppActiveRes[2];
+    HXProtocolType              m_connProt;
 };
 
 #endif /*_LISTENRESP_H_*/

--- rtsp_listenresp.h DELETED ---

--- http_listenresp.h DELETED ---

--- mms_listenresp.h DELETED ---


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic