![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cXProtocolServer.h>
Public Member Functions | |
cXProtocolServerStream (cXProtocolFactory *pProtocolFactory, IUnkObject *pServerConnection, cStreamInput *pStreamInp, cStreamOutput *pStreamOut) | |
virtual | ~cXProtocolServerStream () |
HASHCODE_t | get_HashCode () const noexcept |
virtual bool | isClientSide () const override |
STDMETHOD_ (cString, get_Name)() const override | |
STDMETHOD_ (PLEVEL_TYPE, get_PrivLevel)() const override | |
STDMETHOD_ (bool, CanBeDetectedBy)(const IAuthUser *pViewer) const override | |
virtual HRESULT | DisposeThis () override |
virtual HRESULT | ProcessStreamPacket () override |
virtual HRESULT | WriteString (const char *pszStr) override |
virtual HRESULT | OnTickStream () override |
![]() | |
cProtocolStream (IProtocolFactory *pProtocolFactory, IUnkObject *pServerConnection, cStreamInput *pStreamInp, cStreamOutput *pStreamOut) | |
virtual | ~cProtocolStream () |
HASHCODE_t | get_HashCode () const noexcept |
STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept override | |
STDMETHOD_ (cString, get_Name)() const override | |
STDMETHOD_ (cStringA, get_SymName)() const override | |
bool | isConnected () const |
cStreamInput * | get_StreamInp () const |
cStreamOutput * | get_StreamOut () const |
virtual size_t | get_ProtocolMaxMessageSize () const |
![]() | |
cXProtocolBase (cXProtocolDataMgr *pProtocolDataMgr) | |
virtual | ~cXProtocolBase () |
cXProtocolDataMgr * | get_DataMgr () const |
![]() | |
cXProtocolServerTx (cXProtocolBase &rBase, cStreamOutput *pOut) | |
virtual | ~cXProtocolServerTx () |
HRESULT | Send_Interfaces (cXObject *pObj) |
HRESULT | Send_InterfaceDef (const cScriptableInterfaceDef *pInterfaceDef) |
HRESULT | Send_InterfaceDef (SCRIPTINTERFACEID_t bInterfaceID) |
HRESULT | Send_InterfaceDefs (cXObject *pObj) |
HRESULT | Send_InterfaceDefs (UID_t uid) |
HRESULT | Send_TagDef (cAtomRef atomref) |
HRESULT | Send_PropsI (cXObject *pObj, const cScriptableInterfaceDef *pInterfaceDef) |
HRESULT | Send_Props (cXObject *pObj, const cScriptableInterfaceDef *pInterfaceDef) |
HRESULT | Send_Props (cXObject *pObj, SCRIPTINTERFACEID_t bInterfaceID) |
HRESULT | Send_Prop (UID_t uid, SCRIPTINTERFACEID_t bInterfaceID, SCRIPTPROPID_t bPropIndex, const cVariant &vVal) |
HRESULT | Send_Prop (cXObject *pObj, const cScriptableProp *pProp, const cVariant &vVal) |
HRESULT | Send_PropGet (cXObject *pObj, const cScriptableProp *pProp) |
HRESULT | Send_InvokeResponse (UID_t uid, SCRIPTINTERFACEID_t bInterfaceID, SCRIPTPROPID_t bMethodIndex, const cVariant &vValRet) |
HRESULT | Send_InvokeResponse (cXObject *pObj, const cScriptableMethod *pMethod, const cVariant &vValRet) |
HRESULT | Send_Tags (cXObject *pObj, bool bSendIfEmpty) |
HRESULT | Send_InvokeResponseV (const cVariant &vValRet) |
![]() | |
cStreamOutput () noexcept | |
virtual | ~cStreamOutput () |
virtual HRESULT | WriteX (const void *pData, size_t nDataSize) |
HRESULT | WriteT (const void *pVal, size_t nDataSize) |
template<typename TYPE > | |
HRESULT | WriteT (TYPE val) |
HRESULT | WriteSize (size_t nSize) |
HRESULT | WriteHashCode (HASHCODE_t nHashCode) |
HRESULT | WriteN (const void *pBuffer, size_t nSize) |
template<typename _CH > | |
HRESULT | WriteStringN (const _CH *pszStr) |
template<typename _CH > | |
HRESULT | WriteCharRepeat (_CH nChar, int nCount=1) |
virtual HRESULT | WriteString (const wchar_t *pszStr) |
StrLen_t | VPrintf (const char *pszFormat, va_list args) |
StrLen_t | VPrintf (const wchar_t *pszFormat, va_list args) |
StrLen_t _cdecl | Printf (const char *pszFormat,...) |
StrLen_t _cdecl | Printf (const wchar_t *pszFormat,...) |
HRESULT | WriteStream (cStreamInput &sInp, STREAM_POS_t nSizeMax=k_FILE_BLOCK_SIZE, IStreamProgressCallback *pProgress=nullptr, TIMESYSD_t nTimeout=0) |
Copy cStreamInput to this stream. More... | |
virtual HRESULT | FlushX () |
![]() | |
virtual | ~cStreamBase () |
virtual STREAM_SEEKRET_t | Seek (STREAM_OFFSET_t iOffset, SEEK_ORIGIN_TYPE eSeekOrigin=SEEK_Set) |
void | SeekToBegin () |
STREAM_POS_t | SeekToEnd () |
virtual STREAM_POS_t | GetPosition () const |
virtual STREAM_POS_t | GetLength () const |
Public Attributes | |
cTimeSys | m_timePing |
last time i got a ping from this client More... | |
![]() | |
IProtocolFactory *const | m_pProtocolFactory |
What IProtocolFactory produced this? More... | |
IUnkObject *const | m_pServerConnection |
the cNetServerConnection or other top level parent for this protocol. More... | |
HASHCODE_t const | m_nHashCode |
the m_pClient->get_HashCode() id for this client connection/stream. More... | |
![]() | |
cXProtocolDataMgr *const | m_pProtocolDataMgr |
Point back to the protocol singleton. More... | |
bool | m_bUseHashPropName |
for stuff i send, should i hash the prop names ? XPROTO_HashProp More... | |
cFile | m_FileWork |
The local file we are reading or writing for XPROTO_File. More... | |
Additional Inherited Members | |
![]() | |
static cStringA GRAYCALL | GetMsgName (XPROTO_t bMsg) |
![]() | |
static const size_t | k_Packet_Size_Max = cStream::k_FILE_BLOCK_SIZE + 16 |
![]() | |
static const BYTE | k_SIZE_MASK = 0x80 |
Used for WriteSize() More... | |
static const size_t | k_FILE_BLOCK_SIZE = (32 * 1024) |
default arbitrary transfer block size. more than this is NOT more efficient. More... | |
![]() | |
cStreamInput * | m_pStreamInp |
for use with ProcessStreamPacket() More... | |
cStreamOutput * | m_pStreamOut |
TX responses back to the remote client go here. (e.g. cNetServerConnection->cNetStream) More... | |
cString | m_sName |
a user readable name. Usually the IP address or reverse DNS lookup. can be upgraded as lookup or login becomes avail. m_pClient->get_Name() More... | |
![]() | |
cXProtocolBase & | m_rBase |
Input stream. More... | |
cStreamInput * | m_pStreamRx |
Where to RX from. More... | |
SCRIPTINTERFACEID_t | m_bInterfaceIDUnk |
An interface received that I don't understand (yet)! client only. More... | |
XPROTO_t | m_bMsgReading |
We are in the process of reading/dispatching a message. More... | |
XPROTO_t | m_bMsgReadPrev |
Last message i got and understood. for debug. More... | |
int | m_iMsgNumRx |
Count the messages we received. More... | |
UID_t | m_uidLastRx |
Last UID sent from client. ( be careful order of messages does not change!) More... | |
![]() | |
cXProtocolBase & | m_rBase |
My parent. dumb pointer. More... | |
cStreamOutput * | m_pStreamTx |
Where to TX to. More... | |
XPROTO_t | m_bMsgBuilding |
We are in the process of building a message. not called Send_MsgEnd() yet. More... | |
bool | m_bFileSending |
Must call Send_FileNext() until done. More... | |
int | m_iMsgNumTx |
Count the messages we transmit. More... | |
UID_t | m_uidLastTx |
Last UID i sent. Periodically resend this just in case the other side gets out of sync ? More... | |
I am the server side of the XProtocol connection. I have the information the client wants. This is a servers representation of a single connection to a client.
GrayLib::cXProtocolServerStream::cXProtocolServerStream | ( | cXProtocolFactory * | pProtocolFactory, |
IUnkObject * | pServerConnection, | ||
cStreamInput * | pStreamInp, | ||
cStreamOutput * | pStreamOut | ||
) |
|
virtual |
|
overridevirtual |
Reimplemented from GrayLib::cProtocolStream.
|
inlinenoexcept |
|
inlineoverridevirtual |
Implements GrayLib::cXProtocolBase.
|
protected |
XPROTO_Request|XPROTO_Error only get this as the first Request_Error_Hello.
|
protected |
XPROTO_Request|XPROTO_File Get a request from the client for a file. Send the header to the file.
|
protectedvirtual |
client is requesting a file. XPROTO_File high level check on the request for the file. Rights to request this file? pszReqName = The name of the file as the client understands it.
|
protected |
Request the interface definition information from the server.
XPROTO_Request|XPROTO_InterfaceDef get the request for an interface definition info from the server.
|
protected |
Request a list of cXObject definitions.
XPROTO_Request|XPROTO_Interfaces Client is requesting the types of interfaces supported by the object. Ideally this is expressed in _INC_cXProtocol_H ? and known in advance by both parties!
|
protected |
Client Requests a method invocation.
XPROTO_Request|XPROTO_Invoke client requests Invoke a method on an object in server. int iMsgNum, cVariant& vVal
|
protected |
XPROTO_Ping Client is requesting a keep alive XPROTO_Ping response from the server. Respond to it now.
|
protected |
Request prop.
XPROTO_Request|XPROTO_Prop Client requests a prop of an object UID_t uid, cVariant& vVal
|
protected |
Request props.
XPROTO_Request|XPROTO_Props Get props of an objects interface. UID_t uid, cVariant& vVal
|
protected |
XPROTO_TagDef get a request for Tag Defs
|
protected |
XPROTO_Tags Got a request for tags
|
protected |
XPROTO_File i am setting a file to the server from the client
|
protected |
Client wants to set a prop on some object.
XPROTO_Prop Client wants to set a prop on the server.
|
protected |
Client wants to set a tag on some object.
XPROTO_Tags Client wants to set a tag on some object.
|
protected |
XPROTO_TagDef = set/create/clear a tag
|
overridevirtual |
override for cProtocolStream continue to send blocks of a very large file.
Reimplemented from GrayLib::cProtocolStream.
|
overrideprotectedvirtual |
XPROTO_Error Client sent me back this error. override this virtual
Implements GrayLib::cXProtocolRx.
|
overridevirtual |
cProtocolStream override. incoming data to be processed.
Reimplemented from GrayLib::cProtocolStream.
|
overrideprotectedvirtual |
cXProtocolRx override. called from cXProtocolRx::ProcessStreamPacket() server(me) is getting a message from the client. m_bMsgReading already set. Read a single message from get_StreamRx() starting after m_bMsgReading
Implements GrayLib::cXProtocolRx.
|
inlineoverride |
Override IAuthUser
|
inlineoverridevirtual |
Can override IAuthUser for IP + name of the account for the console.
Implements GrayLib::cXProtocolBase.
|
inlineoverridevirtual |
Server side authorization level for the connected client stream.
Implements GrayLib::cXProtocolBase.
|
overridevirtual |
cStreamOutput override. Allow this to be used as a console. re-route these to proper format for logging etc. e.g. m_pOutConsole and get_SrcConsole() for cScriptContext
Reimplemented from Gray::cStreamOutput.
cTimeSys GrayLib::cXProtocolServerStream::m_timePing |
last time i got a ping from this client