NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
nim_tools_http_def.h 文件参考

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

浏览源代码.

宏定义

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

类型定义

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)
 

枚举

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
}
 

详细描述

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

作者
towik, Oleg
日期
2015/4/30

宏定义说明

◆ INVALID_HTTPREQUESTHANDLE

#define INVALID_HTTPREQUESTHANDLE   (0)

◆ INVALID_HTTPREQUESTID

#define INVALID_HTTPREQUESTID   (0xFFFFFFFF)

类型定义说明

◆ 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

参数
[out]user_data回传的自定义数据
[out]result传输结果,true代表传输成功,false代表传输失败
[out]response_codehttp响应码
返回
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
参数
[out]user_data回传的自定义数据
[out]total_upload_size总的待上传的字节数
[out]uploaded_size已经上传的字节数
[out]total_download_size总的待下载的字节数
[out]downloaded_size已经下载的字节数
返回
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

参数
[out]user_data回传的自定义数据
[out]result传输结果,true代表传输成功,false代表传输失败
[out]response_codehttp响应码
[out]response_contenthttp响应实体内容
返回
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
参数
[out]user_data回传的自定义数据
[out]result传输结果,true代表传输成功,false代表传输失败
[out]response_codehttp响应码
[out]response_contenthttp响应实体内容
[out]response_headerhttp响应头
返回
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

参数
[out]user_data回传的自定义数据
[out]upload_speed实时上传速度(字节每秒)
[out]download_speed实时下载速度(字节每秒)
返回
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
参数
[out]user_data回传的自定义数据
[out]actual_upload_size实际上传的字节数
[out]upload_speed平均上传速度(字节每秒)
[out]actual_download_size实际下载的字节数
[out]download_speed平均下载速度(字节每秒)
返回
void 无返回值

枚举类型说明

◆ NIMProxyType

枚举值
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