SetProtocolInformation function
Use this function to set information of the protocol.Syntax
int __stdcall SetProtocolInformation(
__in ProtocolSession *psess,
__in int type,
__in ProtocolSignature *pSign[],
__in int extraSize,
__in int lowestSupportedVersion
);
Parameters
psess [in] A pointer to a ProtocolSession structure. This is a session assigned to a protocol at the moment it's loaded into the memory.
type [in] This parameter can be one of the following values.
Value | Meaning |
PT_RECEIVER 0 | The protocol is a receiver (e.g. TCP/IP, Bluetooth). It should be able to establish a new connection with a client, receive data and send data to the client.
|
PT_MANIPULATOR 1 | The protocol is a transformer (e.g. SSL/ TLS). When a PT_LABORER protocol requires to receive or send data, this protocol should manipulate the data.
|
PT_LABORER 2 | The protocol is a processor (e.g. HTTP/SMTP/FTP).
|
PT_NO_PROTOCOL 3 | This is not a protocol but does other thing (like an updater).
|
And this parameter can be a combination of the following values, in combination with the previous values.
Value | Meaning |
PT_CONTROLPANEL 0x10000 | The protocol wants the right to acces the settings of all the protocols and will be able to activate new protocols.
|
PT_SUPPORT_PSIGN 0x20000 | The protocol suppports the pSign parameter, please read the remark section for more information.
|
And this parameter can be one of the following values, in combination with the previous values.
Value | Meaning |
PT_UTF_8_CHARSET 0x0 | The unicode strings passed by this protocol are in the UTF-8 charset.
|
pSign [in] A pointer to the buffer with ProtocolSignature structure(s) describing signatures used by this protocol. This parameter can be set to zero. Please read the Remark section for more information.
extraSize [in]lowestSupportedVersion [in] This parameter needs to specify the lowest API version the protocol is supporting. If TV's server does not support this version this function will fail. This parameter can be one of the following values:
Value | Meaning |
V_TV_SERVER_1 0 | A reference to API version 1.00 of TV's server.
|
V_TV_SERVER_101 1 | A reference to API version 1.01 of TV's server.
|
V_TV_SERVER_102 2 | A reference to API version 1.02 of TV's server.
|
Return value
If no error occurs the function returns True (one). If the function fails it will return False (zero).
Remarks
This function can be used when the protocol is initializing in function
StartProtocol.
The
pSign parameter can only be used if the protocol is type PT_LABORER, the flag PT_SUPPORT_PSIGN is set and the client immediately sends data if a new connection is established. For example, if a client connects to a server with the HTTP-protocol the client can send the commands starting with GET, POST or HEAD, these words are the signatures of the protocol. Describing these words in the
pSign paramter will make it possible to bind more than one PT_LABORER protocol in a
ListenSession. TV's server will be able to detect which protocol the client is using by these words and will activate the the protocol that needs to be activated.
Requirements
Should be exported by | -
|
Minimum supported API | 1.00
|
Header | tvsserver_base.h
|