Developer

API Reference

ISOCKET_Writeable()

Brew Release
Brew MP 1.0.2
See Also
Description
This function allows an application to register a callback function to be invoked by the AEE when a non-blocking write operation on the specified socket can make progress. Progress involves writing data or returning an error code -- anything but AEE_NET_WOULDBLOCK. This function is used after a previous write attempt returned AEE_NET_WOULDBLOCK, but it is used even if no write function has been called.
For a datagram socket, ISOCKET_SendTo() can be used on multiple interfaces (e.g. BREW Loopback and PPP) for the same socket. In this case, ISOCKET_Writeable() is tied to the previous call to ISOCKET_SendTo(). If ISOCKET_SendTo() has never been called, ISOCKET_Writeable() is tied to all available interfaces.
NOTE: There is no absolute guarantee that the write function makes progress after the callback, so the caller must always be prepared to call ISOCKET_Writeable() again when the write function returns AEE_NET_WOULDBLOCK.
Parameters
  • pISocket
    []:
    Pointer to the ISocket Interface object for which the callback function needs to be registered.
  • pfn
    []:
    Address of the callback function. This function is invoked by AEE when the socket becomes ready to receive data or when it is ready to be closed. If this is NULL, it cancels the Writeable callback function registered by a previous call to ISOCKET_Writeable().
  • pUser
    []:
    User-defined data that is passed to the callback function when it is invoked.
Interface
ISOCKET
Prototype
    void ISOCKET_Writeable(ISocket * pISocket, PFNNOTIFY pfn, void * pUser)
Return
None.
Side Effect
None.
Comment
The registered callback can be canceled (un-registered) with ISOCKET_Cancel().
Non-blocking write operation include:
  • ISOCKET_Write()
  • ISOCKET_WriteV()
  • ISOCKET_SendTo())
  • ISOCKET_Bind()
  • ISOCKET_Listen()
  • ISOCKET_Shutdown()
  • ISOCKET_Close()
  • Follow