nn::http::Initialize FunctionResult Initialize( uptr bufferAddress = 0, size_t bufferSize = 0 );
| Name | Description | |
|---|---|---|
| in | bufferAddress | Pointer to the start of the POST data buffer. The memory for the buffer must be 4096-byte aligned. |
| in | bufferSize | Size of the POST data buffer. |
Result listed below. | Value | Description |
|---|---|
ResultSuccess |
Process was successful. HTTP library can be used. |
| ResultClientProcessMaxErr | Error indicating that the maximum number of available client processes are already in use. Trying again later may succeed (provided another module calls Finalize in the meantime). |
| ResultIpcSessionMaxErr | Error indicating that the maximum number of IPC sessions are already connected. Trying again later may succeed (provided another IPC session succeeds in the meantime). |
| ResultAlreadyInitializedErr | Error indicating initialization is already complete. HTTP library can already be used. |
| A value other than the above. | Unexpected error (See http_Result.h for details). |
Initializes the HTTP library. Processes that link against the HTTP library must call this before using the library.
You must use the argument to set the POST data buffer in order to use the AddPostData-related functions in nn::http::Connection (the functions that register POST data before Connect).
If you are not using the AddPostData-related functions you do not need to set anything in the argument. (In other words, even if you are using POST operations, nothing needs to be set in the argument if you use only SendPostData-related functions.)
The POST data buffer is used to temporarily store the registered POST data.
For this reason, the buffer size must be at least as large as the maximum total amount of POST data that will be registered at any one time.
(The POST data registered to the nn::http::Connection are stored temporarily in the POST data buffer, sent via POST when nn::http::Connection::Connect executes, and freed when nn::http::Connection::Finalize executes. Accordingly, the size of the POST data buffer must be at least as large as the maximum total amount of POST data that will be registered to the nn::http::Connection at any one time before Finalize.)
CONFIDENTIAL