• 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
  • RecvData function

    The RecvData function receives data from the client.

    Syntax

    int __stdcall RecvData(
    __in ProtocolSession *psess,
    __in ClientSession *sess,
    __in int flags,
    __in int timeout,
    __out char *buf,
    __inout int *len
    );

    Parameters

    psess [in]sess [in]flags [in]
    ValueMeaning
    RSF_RETURN_ON_COMPLETE
    0x0
    The function will return when the operation is completed or when the connection has been lost. If this flag is used on the RecvData Function, 'operation is completed' means it will return when the number of bytes have been received or when the timeout has been reached.
    RSF_RETURN_ON_FIRST_SUCCESSFUL_ATTEMPT
    0x4
    The function will return on the first successful receive attempt and will not pay attention to the len parameter.The function will also return when the connection has been lost or when the timeout has been reached.
    RSF_RETURN_ON_ERROR
    0x1
    The function will return when the first attempt failed or succeed, it will not try to resolve any error.
    RSF_PEEK_DATA
    0x2
    The function will not remove the received data from the internal buffer. This means the Recv function will return the exact same data at next call.

    timeout [in]buf [out]len [inout]

    Return value

    This can be one of the following values:

    ValueMeaning
    CE_NOERR
    0
    No error.
    CE_NO_BUFFER_AVAILABLE
    1
    There is not enough free space available in the internal buffer.
    CE_CONNECTION_CLOSED
    2
    Cannot complete the request because the connection with the client has been closed.
    CE_UNKNOWN_ERROR
    3
    An error occurred and since the RSF_RETURN_ON_ERROR flag is set the function returns.
    CE_TIMEOUT
    4
    A timeout has occurred.

    Requirements

    Should be exported by Receiver and Transformer plugin.
    Minimum supported API 1.00
    Header tvsserver_base.h