mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-10-07 14:13:45 +00:00
流量统计
Signed-off-by: xujie <xujie223@huawei.com>
This commit is contained in:
parent
f97bd96678
commit
30c8236fb2
54
api/@ohos.net.statistics.d.ts
vendored
54
api/@ohos.net.statistics.d.ts
vendored
@ -342,6 +342,58 @@ declare namespace statistics {
|
||||
*/
|
||||
function getTrafficStatsByUid(uidInfo: UidInfo): Promise<NetStatsInfo>;
|
||||
|
||||
/**
|
||||
* Queries the data traffic (including all TCP and UDP data packets) received through a specified sockfd.
|
||||
* @param { number } sockfd - Indicates the file descriptor of the given socket.
|
||||
* @param { AsyncCallback<number> } callback - Returns the data traffic bytes received by the specified sockfd.
|
||||
* @throws { BusinessError } 401 - Parameter error.
|
||||
* @throws { BusinessError } 2100001 - Invalid parameter value.
|
||||
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
|
||||
* @throws { BusinessError } 2100003 - System internal error.
|
||||
* @syscap SystemCapability.Communication.NetManager.Core
|
||||
* @since 11
|
||||
*/
|
||||
function getSockfdRxBytes(sockfd: number, callback: AsyncCallback<number>): void;
|
||||
|
||||
/**
|
||||
* Queries the data traffic (including all TCP and UDP data packets) received through a specified sockfd.
|
||||
* @param { number } sockfd - Indicates the file descriptor of the given socket.
|
||||
* @returns { Promise<number> } Returns the data traffic bytes received by the specified sockfd.
|
||||
* @throws { BusinessError } 401 - Parameter error.
|
||||
* @throws { BusinessError } 2100001 - Invalid parameter value.
|
||||
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
|
||||
* @throws { BusinessError } 2100003 - System internal error.
|
||||
* @syscap SystemCapability.Communication.NetManager.Core
|
||||
* @since 11
|
||||
*/
|
||||
function getSockfdRxBytes(sockfd: number): Promise<number>;
|
||||
|
||||
/**
|
||||
* Queries the data traffic (including all TCP and UDP data packets) sent through a specified sockfd.
|
||||
* @param { number } sockfd - Indicates the file descriptor of the given socket.
|
||||
* @param { AsyncCallback<number> } callback - Returns the data traffic bytes sent by the specified sockfd.
|
||||
* @throws { BusinessError } 401 - Parameter error.
|
||||
* @throws { BusinessError } 2100001 - Invalid parameter value
|
||||
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
|
||||
* @throws { BusinessError } 2100003 - System internal error.
|
||||
* @syscap SystemCapability.Communication.NetManager.Core
|
||||
* @since 11
|
||||
*/
|
||||
function getSockfdTxBytes(sockfd: number, callback: AsyncCallback<number>): void;
|
||||
|
||||
/**
|
||||
* Queries the data traffic (including all TCP and UDP data packets) sent through a specified sockfd.
|
||||
* @param { number } sockfd - Indicates the file descriptor of the given socket.
|
||||
* @returns { Promise<number> } Returns the data traffic bytes sent by the specified sockfd.
|
||||
* @throws { BusinessError } 401 - Parameter error.
|
||||
* @throws { BusinessError } 2100001 - Invalid parameter value
|
||||
* @throws { BusinessError } 2100002 - Operation failed. Cannot connect to service.
|
||||
* @throws { BusinessError } 2100003 - System internal error.
|
||||
* @syscap SystemCapability.Communication.NetManager.Core
|
||||
* @since 11
|
||||
*/
|
||||
function getSockfdTxBytes(sockfd: number): Promise<number>;
|
||||
|
||||
/**
|
||||
* Parameters for obtaining detailed information on network interface traffic usage.
|
||||
* @interface IfaceInfo
|
||||
@ -451,4 +503,4 @@ declare namespace statistics {
|
||||
}
|
||||
}
|
||||
|
||||
export default statistics;
|
||||
export default statistics;
|
||||
|
Loading…
Reference in New Issue
Block a user