• 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
  • BindStruct structure

    Contains information about a chain of protocols to bind to each other.

    Syntax

    typedef struct BindStruct{
    char *protocolName;
    int type;
    int errCode;
    struct BindStruct *next;
    struct BindInitOptions *initOptions;
    } BindStruct;

    Members

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

    errCode
    ValueMeaning
    BE_NOERR
    0
    No error.
    BE_PROTOCOL_LOADING
    1
    The protocol hasn't been loaded yet. The bind request is placed in a que and will be executed when the protocol has been loaded.
    BE_NOT_LOADED
    2
    The protocol is unknown and not loaded.
    BE_NOT_SUPPORTED_PROTOCOL
    3
    This protocol is not supported in the way it is implemented. Please read the remark section for more information.

    nextinitOptions

    Remarks

    If the protocol is binded to more then one protocol and a new connection has been established, the choice of which protocol should handle the connection is based on the first few bytes the client will send. Those first bytes of a protocol can be set by implementing the function GetSignatureProtocol in the plugin.

    Some protocols, like FTP, require the server to send the first set of bytes. It is not possible to bind more then one of those protocols, if you do so, the BE_NOT_SUPPORTED_PROTOCOL error code will be set.

    Requirements

    Minimum supported API 1.00
    Header tvsserver_base.h