mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-11-23 15:20:17 +00:00
Add bindSocket interface
Signed-off-by: fuchao <chao.fu@thundersoft.com>
This commit is contained in:
parent
707fb9d355
commit
c99f91b887
13
api/@ohos.net.connection.d.ts
vendored
13
api/@ohos.net.connection.d.ts
vendored
@ -174,6 +174,17 @@ declare namespace connection {
|
||||
export interface NetHandle {
|
||||
netId: number;
|
||||
|
||||
/**
|
||||
* Binds a TCPSocket or UDPSocket to the current network. All data flows from
|
||||
* the socket will use this network, without being subject to {@link setAppNet}.
|
||||
* Before using this method, ensure that the socket is disconnected.
|
||||
*
|
||||
* @param socketParam Indicates the TCPSocket or UDPSocket object.
|
||||
* @since 9
|
||||
*/
|
||||
bindSocket(socketParam: TCPSocket | UDPSocket, callback: AsyncCallback<void>): void;
|
||||
bindSocket(socketParam: TCPSocket | UDPSocket): Promise<void>;
|
||||
|
||||
/**
|
||||
* Resolves a host name to obtain all IP addresses based on the specified NetHandle.
|
||||
*
|
||||
@ -275,4 +286,4 @@ declare namespace connection {
|
||||
}
|
||||
}
|
||||
|
||||
export default connection;
|
||||
export default connection;
|
||||
|
Loading…
Reference in New Issue
Block a user