tfSmtpUserSetAsyncCB
Table of Contents >> Optional Protocols >> SMTP
| #include <trsocket.h> |
| int tfSmtpUserSetAsyncCB | ( |
| ttSmtpClientHandle smtpClientHandle, | |
| ttSmtpAsyncCbFuncPtr asyncCbFuncPtr | |
| ); |
Function Description
If you are running a non-blocking SMTP client and need more responsiveness (see Performance concerns when using non-blocking mode), you can hook into the asynchronous socket event callback used by the SMTP client. Your asynchronous SMTP event callback function will be alerted when there is activity on the underlying TCP socket that requires a call tfSmtpUserExecute(). Knowing exactly when to call tfSmtpUserExecute() to service replies from the server can speed up your non-blocking session if you require a lot of SMTP transactions (many recipients or messages).This function can safely be called from an asynchronous SMTP event callback function.
To use this feature you must uncomment the following configuration macro in trsystem.h.
#define TM_USE_SMTP_ASYNC_CB
Parameters
- smtpClientHandle
- The SMTP client session handle as returned by tfSmtpUserNewSession().
- asyncCbFuncPtr
- A pointer to your asynchronous SMTP event callback function.
Returns
- TM_ENOERROR
- Success.
- TM_EINVAL
- Invalid SMTP client session handle.