From d7b7108210b9ff5fb4340b8c3decb12c34cebb72 Mon Sep 17 00:00:00 2001 From: BianYafei Date: Wed, 28 Sep 2022 13:21:27 +0800 Subject: [PATCH] =?UTF-8?q?bindSocket=E6=8E=A5=E5=8F=A3=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: BianYafei Change-Id: I01f24008441a972a0f941f89c581c0a2a2a76b52 --- api/@ohos.net.connection.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/@ohos.net.connection.d.ts b/api/@ohos.net.connection.d.ts index 8fdc697962..d2b6b311e5 100644 --- a/api/@ohos.net.connection.d.ts +++ b/api/@ohos.net.connection.d.ts @@ -174,6 +174,16 @@ 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. + */ + bindSocket(socketParam: TCPSocket | UDPSocket, callback: AsyncCallback): void; + bindSocket(socketParam: TCPSocket | UDPSocket): Promise; + /** * Resolves a host name to obtain all IP addresses based on the specified NetHandle. * -- Gitee