5 #ifndef _INC_cProtocol_H
6 #define _INC_cProtocol_H
11 #include "../GrayLibBase.h"
57 return get_HashCode();
73 return(m_pStreamOut !=
nullptr);
83 virtual size_t get_ProtocolMaxMessageSize()
const;
89 if (m_pStreamOut !=
nullptr)
91 m_pStreamInp =
nullptr;
92 m_pStreamOut =
nullptr;
100 if (m_pStreamOut ==
nullptr)
116 ASSERT(m_pStreamInp !=
nullptr);
154 HRESULT TestProtocol(
const BYTE* pPrefixData,
size_t iPrefixLen, OUT
IProtocolFactory*& rpProtocolFactory)
const;
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define HRESULT_WIN32_C(x)
a constant LSTATUS/error_status_t with no check, unlike HRESULT_FROM_WIN32()
Definition: HResult.h:79
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define ASSERT(exp)
Definition: cDebugAssert.h:87
Definition: cProtocol.h:147
cArrayPtr< IProtocolFactory > m_aProtocols
array of possible protocols we support.
Definition: cProtocol.h:151
Definition: cProtocol.h:24
cStreamInput * m_pStreamInp
for use with ProcessStreamPacket()
Definition: cProtocol.h:39
cStreamOutput * m_pStreamOut
TX responses back to the remote client go here. (e.g. cNetServerConnection->cNetStream)
Definition: cProtocol.h:40
IUnkObject *const m_pServerConnection
the cNetServerConnection or other top level parent for this protocol.
Definition: cProtocol.h:35
cStreamInput * get_StreamInp() const
Definition: cProtocol.h:75
virtual HRESULT ProcessStreamPacket()
Definition: cProtocol.h:108
virtual HRESULT DisposeThis()
Definition: cProtocol.h:85
HASHCODE_t get_HashCode() const noexcept
Definition: cProtocol.h:48
cString m_sName
a user readable name. Usually the IP address or reverse DNS lookup. can be upgraded as lookup or logi...
Definition: cProtocol.h:42
STDMETHOD_(cString, get_Name)() const override
Definition: cProtocol.h:59
virtual HRESULT OnTickStream()
Definition: cProtocol.h:97
IProtocolFactory *const m_pProtocolFactory
What IProtocolFactory produced this?
Definition: cProtocol.h:34
bool isConnected() const
Definition: cProtocol.h:71
STDMETHOD_(HASHCODE_t, get_HashCodeX)() const noexcept override
Definition: cProtocol.h:53
HASHCODE_t const m_nHashCode
the m_pClient->get_HashCode() id for this client connection/stream.
Definition: cProtocol.h:36
cStreamOutput * get_StreamOut() const
Definition: cProtocol.h:79
STDMETHOD_(cStringA, get_SymName)() const override
Definition: cProtocol.h:65
Definition: cStream.h:126
cIUnkPtr< cProtocolStream > cProtocolStreamPtr
Definition: cProtocol.h:122
WORD RADIX_t
Base for convert of numbers to strings. e.g. 10 base vs 16 base hex numbers.
Definition: StrChar.h:27
UINT_PTR HASHCODE_t
could hold a pointer converted to a number? maybe 64 or 32 bit ? same as size_t.
Definition: GrayCore.h:116
const char *__stdcall StrArg< char >(const char *pszStr) noexcept
Definition: StrArg.h:63
Definition: cProtocol.h:125
virtual cProtocolStreamPtr CreateProtocolStream(IUnkObject *pServerConnection, cStreamInput *pStreamInp, cStreamOutput *pStreamOut)=0
virtual ~IProtocolFactory()
Definition: cProtocol.h:132
virtual size_t get_ProtocolMaxMessageSize() const
Definition: cProtocol.h:135
virtual HRESULT TestProtocol(const BYTE *pszPrefixData, size_t iPrefixLen) const =0
virtual const char * get_ProtocolName() const =0