• About TV's server
  • New in version 3.20
  • New in version 3.10
  • About the source code
  • About protocols/plugins
  • TV's server API
  • Protocol Initialisation
  • Protocol binding
  • Protocol Listening and handling
  • Protocol data storage
  • Control panel
  • Multi column list
  • Time and date
  • Http protocol functions
  • Unimplemented and/or replaced functions
  • 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]type [in]
    ValueMeaning
    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).

    ValueMeaning
    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.

    ValueMeaning
    PT_UTF_8_CHARSET
    0x0
    The unicode strings passed by this protocol are in the UTF-8 charset.

    pSign [in]extraSize [in]lowestSupportedVersion [in]
    ValueMeaning
    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