net.Curl.Multi
Manages multiple concurrent Easy requests.
Methods
multi.setOpt(option, parameter)
Sets an option for the multi handle. See net.Curl.Multi.option.
multi.onMessage(callback)
Registers a callback invoked when an Easy request completes (success or failure).
callback(easyHandle, result) => void| Parameter | Type | Description |
|---|---|---|
easyHandle | net.Curl.Easy | The Easy instance that completed. |
result | Number | Result code. See net.Curl.Easy.code. |
Returns: Number — See net.Curl.Multi.code.
multi.addHandle(easy)
Adds an Easy instance and begins the request.
Returns: Number — See net.Curl.Multi.code.
multi.removeHandle(easy)
Removes a running Easy instance and stops it.
Returns: Number — See net.Curl.Multi.code.
multi.getCount()
Returns the number of running Easy instances.
Returns: Number
net.Curl.Multi.strError(code)
Returns a description for the given code.
Returns: String
net.Curl.Multi.code
| Code | Description |
|---|---|
OK | No error |
BAD_HANDLE | Invalid multi handle |
BAD_EASY_HANDLE | Invalid easy handle |
OUT_OF_MEMORY | Out of memory |
INTERNAL_ERROR | Internal error |
BAD_SOCKET | Invalid socket argument |
UNKNOWN_OPTION | Unknown option |
ADDED_ALREADY | The easy handle is already added to a multi handle |
net.Curl.Multi.option
| Option | Description |
|---|---|
MAXCONNECTS | Maximum entries in the connection cache |
MAX_HOST_CONNECTIONS | Maximum connections to one host |
MAX_PIPELINE_LENGTH | Maximum requests in a pipeline |
PIPELINING | Set to 1 to enable pipelining |
MAX_TOTAL_CONNECTIONS | Maximum total open connections |
net.Curl.Multi.seekfunc
Return codes for the seek callback (SEEKFUNCTION option).
| Code | Description |
|---|---|
OK | Seek succeeded |
FAIL | Fail the entire transfer |
CANTSEEK | Tell curl seeking can't be done |