Developer

API Reference

ISOURCEUTIL_SourceFromSocket()

Brew Release
Brew MP 1.0.2
See Also
Error Codes ISourceUtil
Description
This function makes a new ISource Interface object that gets data from an ISocket Interface object.
Parameters
  • pISourceUtil
    []:
    [in] Pointer to the ISourceUtil Interface object.
  • ps
    []:
    [in] ISocket Interface object to read from.
  • ppirs
    []:
    [in/out] Pointer to the interface pointer to be filled with resulting ISource Interface object.
Interface
ISOURCEUTIL
Prototype
   int32 ISOURCEUTIL_SourceFromSocket(ISourceUtil *  pISourceUtil,
                                      ISocket *      ps,
                                      ISource **     ppirs);
Return
AEE_SUCCESS, if successful.
AEE_ENOMEMORY, if the function can't make a new ISource Interface object.
Side Effect
None
Comment
User can query to see if data is available in socket connection without reading the data. This can be done by obtaining the ISource object from the ISocket object by calling ISOURCEUTIL_SourceFromSocket() and then to get the IPeek object from ISource object by calling ISOURCEUTIL_PeekFromSource() then to use IPeek interface to check on the data.
Note that technically the data is consumed out of the actual "socket" source and put into the IPeek buffer, but the data can be retrieved even after checking it out. When IPEEK_Advance is called the data will be considered "consumed" fully.
  • Follow