From 8fe37bb3d5190a0cfb39983e25cb3fc8d192f84f Mon Sep 17 00:00:00 2001 From: king_he <6384784@qq.com> Date: Sat, 21 May 2022 09:44:40 +0000 Subject: [PATCH] update en/application-dev/connectivity/socket-connection.md. Signed-off-by: king_he <6384784@qq.com> --- .../connectivity/socket-connection.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/en/application-dev/connectivity/socket-connection.md b/en/application-dev/connectivity/socket-connection.md index 5f50f7bdcc..ede8acfcbe 100644 --- a/en/application-dev/connectivity/socket-connection.md +++ b/en/application-dev/connectivity/socket-connection.md @@ -10,26 +10,26 @@ Your application can transmit data through Socket connections. Currently, the TC The Socket connection function is mainly implemented by the Socket module. The following table describes the related APIs. -| API| Description| +| API| Description | | -------- | -------- | -| constructUDPSocketInstance() | Creates a **UDPSocket** object.| -| constructTCPSocketInstance() | Creates a **TCPSocket** object.| -| bind() | Binds the IP address and port number.| +| constructUDPSocketInstance() | Creates a **UDPSocket** object. | +| constructTCPSocketInstance() | Creates a **TCPSocket** object. | +| bind() | Binds the IP address and port number. | | send() | Sends data.| -| close() | Closes a Socket connection.| -| getState() | Obtains the Socket connection status.| -| connect() | Connects to the specified IP address and port. This function is supported only for TCP.| -| getRemoteAddress() | Obtains the peer address of the Socket connection. This function is supported only for TCP. The **connect** API must have been called before you use this API.| -| on(type: 'message') | Enables listening for **message** events of the Socket connection.| -| off(type: 'message') | Disables listening for **message** events of the Socket connection.| -| on(type: 'close') | Enables listening for **close** events of the Socket connection.| -| off(type: 'close') | Disables listening for **close** events of the Socket connection.| -| on(type: 'error') | Enables listening for **error** events of the Socket connection.| -| off(type: 'error') | Disables listening for **error** events of the Socket connection.| +| close() | Closes a Socket connection. | +| getState() | Obtains the Socket connection status. | +| connect() | Connects to the specified IP address and port. This function is supported only for TCP. | +| getRemoteAddress() | Obtains the peer address of the Socket connection. This function is supported only for TCP. The **connect** API must have been called before you use this API. | +| on(type: 'message') | Enables listening for **message** events of the Socket connection. | +| off(type: 'message') | Disables listening for **message** events of the Socket connection. | +| on(type: 'close') | Enables listening for **close** events of the Socket connection. | +| off(type: 'close') | Disables listening for **close** events of the Socket connection. | +| on(type: 'error') | Enables listening for **error** events of the Socket connection. | +| off(type: 'error') | Disables listening for **error** events of the Socket connection. | | on(type: 'listening') | Enables listening for **listening** events of the UDPSocket connection. | | off(type: 'listening') | Disables listening for **listening** events of the UDPSocket connection. | | on(type: 'connect') | Enables listening for **connect** events of the TCPSocket connection. | -| off(type: 'connect') | Disables listening for **connect** events of the TCPSocket connection.| +| off(type: 'connect') | Disables listening for **connect** events of the TCPSocket connection. | ## How to Develop -- GitLab