NIM SDK API  8.5.0
Macros | Typedefs | Enumerations
nim_tools_http_def.h File Reference

NIM HTTP提供的http传输相关接口的定义 More...

Go to the source code of this file.

Macros

#define INVALID_HTTPREQUESTHANDLE   (0)
 
#define INVALID_HTTPREQUESTID   (0xFFFFFFFF)
 

Typedefs

typedef void * HttpRequestHandle
 
typedef unsigned int HttpRequestID
 
typedef void(* nim_http_request_completed_cb) (const void *user_data, bool result, int response_code)
 
typedef void(* nim_http_request_response_cb) (const void *user_data, bool result, int response_code, const char *response_content)
 
typedef void(* nim_http_request_response_ex_cb) (const void *user_data, bool result, int response_code, const char *response_content, const char *response_header)
 
typedef void(* nim_http_request_progress_cb) (const void *user_data, double total_upload_size, double uploaded_size, double total_download_size, double downloaded_size)
 
typedef void(* nim_http_request_transfer_cb) (const void *user_data, double actual_upload_size, double upload_speed, double actual_download_size, double download_speed)
 
typedef void(* nim_http_request_speed_cb) (const void *user_data, double upload_speed, double download_speed)
 

Enumerations

enum  NIMProxyType {
  kNIMProxyNone = 0, kNIMProxyHttp11 = 1, kNIMProxySocks4 = 4, kNIMProxySocks4a = 5,
  kNIMProxySocks5 = 6, kNIMProxyNrtc = 10, kNIMProxyNone = 0, kNIMProxyHttp11 = 1,
  kNIMProxySocks4 = 4, kNIMProxySocks4a = 5, kNIMProxySocks5 = 6, kNIMProxySocks5HostName = 7
}
 

Detailed Description

NIM HTTP提供的http传输相关接口的定义

Author
towik, Oleg
Date
2015/4/30

Typedef Documentation

◆ HttpRequestHandle

http任务句柄

◆ HttpRequestID

http任务ID,当请求发送后会生成此ID,取消任务或读取应答头都使用该ID

◆ nim_http_request_completed_cb

void(* nim_http_request_completed_cb)(const void *user_data, bool, int)

nim callback function that has been registered in nim_http_create_*** API

Parameters
[out]user_data回传的自定义数据
[out]result传输结果,true代表传输成功,false代表传输失败
[out]response_codehttp响应码
Returns
void 无返回值

◆ nim_http_request_progress_cb

void(* nim_http_request_progress_cb)(const void *user_data, double total_upload_size, double uploaded_size, double total_download_size, double downloaded_size) nim callback function that has been registered in nim_http_set_request_progress_cb API
Parameters
[out]user_data回传的自定义数据
[out]total_upload_size总的待上传的字节数
[out]uploaded_size已经上传的字节数
[out]total_download_size总的待下载的字节数
[out]downloaded_size已经下载的字节数
Returns
void 无返回值

◆ nim_http_request_response_cb

void(* nim_http_request_response_cb)(const void *user_data, bool result, int response_code, const char *response_content)

nim callback function that has been registered in nim_http_create_*** API

Parameters
[out]user_data回传的自定义数据
[out]result传输结果,true代表传输成功,false代表传输失败
[out]response_codehttp响应码
[out]response_contenthttp响应实体内容
Returns
void 无返回值

◆ nim_http_request_response_ex_cb

void(* nim_http_request_response_ex_cb)(const void *user_data, bool result, int response_code, const char *response_content, const char *response_header) nim callback function that has been registered in nim_http_create_ ***API
Parameters
[out]user_data回传的自定义数据
[out]result传输结果,true代表传输成功,false代表传输失败
[out]response_codehttp响应码
[out]response_contenthttp响应实体内容
[out]response_headerhttp响应头
Returns
void 无返回值

◆ nim_http_request_speed_cb

void(* nim_http_request_speed_cb)(const void *user_data, double, double)

nim callback function that has been registered in nim_http_set_request_speed_cb API

Parameters
[out]user_data回传的自定义数据
[out]upload_speed实时上传速度(字节每秒)
[out]download_speed实时下载速度(字节每秒)
Returns
void 无返回值

◆ nim_http_request_transfer_cb

void(* nim_http_request_transfer_cb)(const void *user_data, double total_upload_size, double uploaded_size, double total_download_size, double downloaded_size) nim callback function that has been registered in nim_http_set_request_transfer_cb API
Parameters
[out]user_data回传的自定义数据
[out]actual_upload_size实际上传的字节数
[out]upload_speed平均上传速度(字节每秒)
[out]actual_download_size实际下载的字节数
[out]download_speed平均下载速度(字节每秒)
Returns
void 无返回值

Enumeration Type Documentation

◆ NIMProxyType

Enumerator
kNIMProxyNone 

不使用代理

kNIMProxyHttp11 

HTTP 1.1 Proxy(暂不支持)

kNIMProxySocks4 

Socks4 Proxy

kNIMProxySocks4a 

Socks4a Proxy

kNIMProxySocks5 

Socks5 Proxy

kNIMProxyNrtc 

云信音视频私有代理,只在nim_vchat_set_proxy中有效

kNIMProxyNone 

不使用代理

kNIMProxyHttp11 

HTTP 1.1 Proxy

kNIMProxySocks4 

Socks4 Proxy

kNIMProxySocks4a 

Socks4a Proxy

kNIMProxySocks5 

Socks5 Proxy

kNIMProxySocks5HostName 

Socks5 host Proxy