tfHttpcUserOpen
Table of Contents >> Application Reference >> Web Client
| #include <trsocket.h> |
| int tfHttpcUserOpen | ( |
| int addrFamily, | |
| ttHttpcUserEventHandler handlerPtr, | |
| int * errorCodePtr, | |
| int flags | |
| ); |
Function Description
The user needs to call this function before trying to connect to a HTTP server. This function allocates a HTTP client connection structure, creates a TCP socket, stores it in the client connection structure and returns the connection handle to the user.
Parameters
- addrFamily
- Socket address family
- handlerPtr
- User event handler. Please see the ttHttpcUserEventHandler function prototype.
- errorCodePtr
- Pointer to the error code, cannot be NULL
- flags
- Currently unused.
Returns
- NON-NULL
- Handle to the newly allocated connection
- NULL
- Error, check the error code in errorCodePtr
Error Codes
- TM_ENOERROR
- Successful
- TM_EAFNOSUPPORT
- Address family not supported
- TM_ENOBUFS
- Not enough memory