提交 d2c6aa71 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 283b8557
# @ohos.net.webSocket (WebSocket Connection)
# # @ohos.net.webSocket (WebSocket Connection)
The **webSocket** module implements WebSocket connection management and operation.
> **NOTE**<br>
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> **NOTE**
>
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
You can use WebSocket to establish a bidirectional connection between a server and a client. Before doing this, you need to use the [createWebSocket](#websocketcreatewebsocket) API to create a [WebSocket](#websocket) object and then use the [connect](#connect) API to connect to the server. If the connection is successful, the client will receive a callback of the [open](#onopen) event. Then, the client can communicate with the server using the [send](#send) API. When the server sends a message to the client, the client will receive a callback of the [message](#onmessage) event. If the client no longer needs this connection, it can call the [close](#close) API to disconnect from the server. Then, the client will receive a callback of the [close](#onclose) event.
......@@ -17,7 +16,7 @@ If an error occurs in any of the preceding processes, the client will receive a
import webSocket from '@ohos.net.webSocket';
```
## Complete Example
## Examples
```js
import webSocket from '@ohos.net.webSocket';
......@@ -37,7 +36,7 @@ ws.on('open', (err, value) => {
});
ws.on('message', (err, value) => {
console.log("on message, message:" + value);
// When receiving the bye message (the actual message name may differ) from the server, the client proactively disconnects from the server.
// When receiving the `bye` message (the actual message name may differ) from the server, the client proactively disconnects from the server.
if (value === 'bye') {
ws.close((err, value) => {
if (!err) {
......@@ -49,7 +48,7 @@ ws.on('message', (err, value) => {
}
});
ws.on('close', (err, value) => {
console.log("on close, code is " + value['code'] + ", reason is " + value['reason']);
console.log("on close, code is " + value.code + ", reason is " + value.reason);
});
ws.on('error', (err) => {
console.log("on error, error:" + JSON.stringify(err));
......@@ -71,7 +70,7 @@ Creates a WebSocket connection. You can use this API to create or close a WebSoc
**System capability**: SystemCapability.Communication.NetStack
**Return Value**
**Return value**
| Type | Description |
| :---------------------------------- | :----------------------------------------------------------- |
......@@ -94,7 +93,7 @@ connect\(url: string, callback: AsyncCallback<boolean\>\): void
Initiates a WebSocket request to establish a WebSocket connection to a given URL. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.INTERNET
**Required permissions**: ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetStack
......@@ -105,6 +104,12 @@ Initiates a WebSocket request to establish a WebSocket connection to a given URL
| url | string | Yes | URL for establishing a WebSocket connection.|
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result. |
**Error codes**
| ID| Error Message |
| ------- | ----------------------- |
| 401 | Parameter error. |
| 201 | Permission denied. |
**Example**
......@@ -127,7 +132,7 @@ connect\(url: string, options: WebSocketRequestOptions, callback: AsyncCallback<
Initiates a WebSocket request carrying specified options to establish a WebSocket connection to a given URL. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.INTERNET
**Required permissions**: ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetStack
......@@ -139,6 +144,12 @@ Initiates a WebSocket request carrying specified options to establish a WebSocke
| options | WebSocketRequestOptions | Yes | Request options. For details, see [WebSocketRequestOptions](#websocketrequestoptions).|
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result. |
**Error codes**
| ID| Error Message |
| ------- | ----------------------- |
| 401 | Parameter error. |
| 201 | Permission denied. |
**Example**
......@@ -166,7 +177,7 @@ connect\(url: string, options?: WebSocketRequestOptions\): Promise<boolean\>
Initiates a WebSocket request carrying specified options to establish a WebSocket connection to a given URL. This API uses a promise to return the result.
**Required permission**: ohos.permission.INTERNET
**Required permissions**: ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetStack
......@@ -177,12 +188,19 @@ Initiates a WebSocket request carrying specified options to establish a WebSocke
| url | string | Yes | URL for establishing a WebSocket connection. |
| options | WebSocketRequestOptions | No | Request options. For details, see [WebSocketRequestOptions](#websocketrequestoptions).|
**Return Value**
**Return value**
| Type | Description |
| :----------------- | :-------------------------------- |
| Promise\<boolean\> | Promise used to return the result.|
**Error codes**
| ID| Error Message |
| ------- | ----------------------- |
| 401 | Parameter error. |
| 201 | Permission denied. |
**Example**
```js
......@@ -203,7 +221,7 @@ send\(data: string | ArrayBuffer, callback: AsyncCallback<boolean\>\): void
Sends data through a WebSocket connection. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.INTERNET
**Required permissions**: ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetStack
......@@ -214,6 +232,13 @@ Sends data through a WebSocket connection. This API uses an asynchronous callbac
| data | string \| ArrayBuffer <sup>8+</sup> | Yes | Data to send.|
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result. |
**Error codes**
| ID| Error Message |
| ------- | ----------------------- |
| 401 | Parameter error. |
| 201 | Permission denied. |
**Example**
```js
......@@ -237,7 +262,7 @@ send\(data: string | ArrayBuffer\): Promise<boolean\>
Sends data through a WebSocket connection. This API uses a promise to return the result.
**Required permission**: ohos.permission.INTERNET
**Required permissions**: ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetStack
......@@ -247,12 +272,19 @@ Sends data through a WebSocket connection. This API uses a promise to return the
| ------ | ------ | ---- | ------------ |
| data | string \| ArrayBuffer <sup>8+</sup> | Yes | Data to send.|
**Return Value**
**Return value**
| Type | Description |
| :----------------- | :-------------------------------- |
| Promise\<boolean\> | Promise used to return the result.|
**Error codes**
| ID| Error Message |
| ------- | ----------------------- |
| 401 | Parameter error. |
| 201 | Permission denied. |
**Example**
```js
......@@ -275,7 +307,7 @@ close\(callback: AsyncCallback<boolean\>\): void
Closes a WebSocket connection. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.INTERNET
**Required permissions**: ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetStack
......@@ -285,6 +317,13 @@ Closes a WebSocket connection. This API uses an asynchronous callback to return
| -------- | ------------------------ | ---- | ---------- |
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.|
**Error codes**
| ID| Error Message |
| ------- | ----------------------- |
| 401 | Parameter error. |
| 201 | Permission denied. |
**Example**
```js
......@@ -306,7 +345,7 @@ close\(options: WebSocketCloseOptions, callback: AsyncCallback<boolean\>\): void
Closes a WebSocket connection carrying specified options such as **code** and **reason**. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.INTERNET
**Required permissions**: ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetStack
......@@ -317,6 +356,13 @@ Closes a WebSocket connection carrying specified options such as **code** and **
| options | WebSocketCloseOptions | Yes | Request options. For details, see [WebSocketCloseOptions](#websocketcloseoptions).|
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result. |
**Error codes**
| ID| Error Message |
| ------- | ----------------------- |
| 401 | Parameter error. |
| 201 | Permission denied. |
**Example**
```js
......@@ -341,7 +387,7 @@ close\(options?: WebSocketCloseOptions\): Promise<boolean\>
Closes a WebSocket connection carrying specified options such as **code** and **reason**. This API uses a promise to return the result.
**Required permission**: ohos.permission.INTERNET
**Required permissions**: ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetStack
......@@ -351,12 +397,19 @@ Closes a WebSocket connection carrying specified options such as **code** and **
| ------- | --------------------- | ---- | ----------------------------------------------------- |
| options | WebSocketCloseOptions | No | Request options. For details, see [WebSocketCloseOptions](#websocketcloseoptions).|
**Return Value**
**Return value**
| Type | Description |
| :----------------- | :-------------------------------- |
| Promise\<boolean\> | Promise used to return the result.|
**Error codes**
| ID| Error Message |
| ------- | ----------------------- |
| 401 | Parameter error. |
| 201 | Permission denied. |
**Example**
```js
......@@ -406,7 +459,7 @@ off\(type: 'open', callback?: AsyncCallback<Object\>\): void
Disables listening for the **open** events of a WebSocket connection. This API uses an asynchronous callback to return the result.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>**NOTE**
>You can pass the callback of the **on** function if you want to cancel listening for a certain type of event. If you do not pass the callback, you will cancel listening for all events.
**System capability**: SystemCapability.Communication.NetStack
......@@ -437,7 +490,7 @@ on\(type: 'message', callback: AsyncCallback<string | ArrayBuffer\>\): void
Enables listening for the **message** events of a WebSocket connection. This API uses an asynchronous callback to return the result. The maximum length of each message is 4 KB. If the length exceeds 4 KB, the message is automatically fragmented.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>**NOTE**
>The data in **AsyncCallback** can be in the format of string\(API 6\) or ArrayBuffer\(API 8\).
**System capability**: SystemCapability.Communication.NetStack
......@@ -449,7 +502,6 @@ Enables listening for the **message** events of a WebSocket connection. This API
| type | string | Yes | Event type.<br />**message**: event indicating that a message has been received from the server.|
| callback | AsyncCallback\<string \| ArrayBuffer <sup>8+</sup>\> | Yes | Callback used to return the result. |
**Example**
```js
......@@ -466,7 +518,7 @@ off\(type: 'message', callback?: AsyncCallback<string | ArrayBuffer\>\): void
Disables listening for the **message** events of a WebSocket connection. This API uses an asynchronous callback to return the result. The maximum length of each message is 4 KB. If the length exceeds 4 KB, the message is automatically fragmented.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>**NOTE**
>The data in **AsyncCallback** can be in the format of string\(API 6\) or ArrayBuffer\(API 8\).
>You can pass the callback of the **on** function if you want to cancel listening for a certain type of event. If you do not pass the callback, you will cancel listening for all events.
......@@ -507,7 +559,7 @@ Enables listening for the **close** events of a WebSocket connection. This API u
```js
let ws = webSocket.createWebSocket();
ws.on('close', (err, value) => {
console.log("on close, code is " + value['code'] + ", reason is " + value['reason']);
console.log("on close, code is " + value.code + ", reason is " + value.reason);
});
```
......@@ -518,7 +570,7 @@ off\(type: 'close', callback?: AsyncCallback<\{ code: number, reason: string \}\
Disables listening for the **close** events of a WebSocket connection. This API uses an asynchronous callback to return the result.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>**NOTE**
>You can pass the callback of the **on** function if you want to cancel listening for a certain type of event. If you do not pass the callback, you will cancel listening for all events.
**System capability**: SystemCapability.Communication.NetStack
......@@ -530,7 +582,6 @@ Disables listening for the **close** events of a WebSocket connection. This API
| type | string | Yes | Event type. <br />**close**: event indicating that a WebSocket connection has been closed.|
| callback | AsyncCallback<{ code: number, reason: string }> | No | Callback used to return the result. |
**Example**
```js
......@@ -554,7 +605,6 @@ Enables listening for the **error** events of a WebSocket connection. This API u
| type | string | Yes | Event type.<br />**error**: event indicating the WebSocket connection has encountered an error.|
| callback | ErrorCallback | Yes | Callback used to return the result. |
**Example**
```js
......@@ -571,7 +621,7 @@ off\(type: 'error', callback?: ErrorCallback\): void
Disables listening for the **error** events of a WebSocket connection. This API uses an asynchronous callback to return the result.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>**NOTE**
>You can pass the callback of the **on** function if you want to cancel listening for a certain type of event. If you do not pass the callback, you will cancel listening for all events.
**System capability**: SystemCapability.Communication.NetStack
......@@ -621,8 +671,8 @@ You can customize the result codes sent to the server. The result codes in the f
| Value | Description |
| :-------- | :----------------- |
| 1000 | Normally closed |
| 1001 | Connection closed by the server |
| 1002 | Incorrect protocol |
| 1003 | Data unable to be processed|
| 1004~1015 | Reserved |
| 1000 | Normally closed. |
| 1001 | Connection closed by the server. |
| 1002 | Incorrect protocol. |
| 1003 | Data unable to be processed.|
| 1004~1015 | Reserved. |
# HTTP Error Codes
## 2300001 Protocol Not Supported
**Error Message**
Unsupported protocol.
**Description**
This error code is reported if the input protocol version is not supported by the server.
**Cause**
The input protocol version is not supported by the server.
**Solution**
Specify a protocol version supported by the server.
## 2300003 Incorrect URL Format
**Error Message**
URL using bad/illegal format or missing URL.
**Description**
This error code is reported if the URL format is incorrect.
**Cause**
The format of the input URL is incorrect.
**Solution**
Specify a URL of the correct format.
## 2300005 Failed to Resolve the Domain Name of the Proxy Server
**Error Message**
Couldn't resolve proxy name.
**Description**
This error code is reported if the domain name of the proxy server cannot be resolved.
**Cause**
This error code is reported if the URL of the proxy server is incorrect.
**Solution**
Specify a URL of the correct format.
## 2300006 Failed to Resolve the Domain Name of the Host
**Error Message**
Couldn't resolve host name.
**Description**
This error code is reported if the domain name of the host cannot be resolved.
**Cause**
1. The input URL is incorrect.
2. The network connection is abnormal.
**Solution**
1. Specify a URL of the correct format.
2. Rectify network connection faults.
## 2300007 Failed to Connect to the Server
**Error Message**
Couldn't connect to server.
**Description**
This error code is reported if the server connection failed.
**Cause**
The format of the input URL is incorrect.
**Solution**
Specify a URL of the correct format.
## 2300008 Invalid Data Returned by the Server
**Error Message**
Weird server reply.
**Description**
This error code is reported if the data returned by the server is invalid.
**Cause**
The server encounters an error and returns data in non-HTTP format.
**Solution**
Check the server implementation.
## 2300009 Access to Remote Resources Denied
**Error Message**
Access denied to remote resource.
**Description**
This error code is reported if the access to remote resources is denied by the server.
**Cause**
The access to the specified resource is denied by the server.
**Solution**
Check whether access to the requested resource is allowed.
## 2300016 HTT2 Framing Layer Error
**Error Message**
Error in the HTTP2 framing layer.
**Description**
This error code is reported if an error occurs on the HTTP2 framing layer.
**Cause**
HTTP2 is not supported by the server.
**Solution**
Capture and analyze packets to check whether HTTP2 is supported by the server.
## 2300018 Incomplete Data Returned by the Server
**Error Message**
Transferred a partial file.
**Description**
This error code is reported if data returned by the server is incomplete.
**Cause**
This problem is probable due to server implementation.
**Solution**
Check the server implementation.
## 2300023 Failed to Write Received Data to a Disk or Application
**Error Message**
Failed writing received data to disk/application.
**Description**
This error code is reported if an error occurs while writing received data to the disk or application.
**Cause**
The application does not have the data write permission.
**Solution**
Check the permissions granted to the application.
## 2300025 Failed to Upload Data
**Error Message**
Upload failed.
**Description**
This error code is reported if data upload fails.
**Cause**
The file is too large or the network is faulty. The server may reject the **STOR** command if FTP is used.
**Solution**
Check the file size and network status.
## 2300026 Failed to Open or Read Local Data from a File or Application
**Error Message**
Failed to open/read local data from file/application.
**Description**
This error code is reported if an error occurs while opening or reading local data from a file or application.
**Cause**
The application does not have the data read permission.
**Solution**
Check the permissions granted to the application.
## 2300027 Insufficient Memory
**Error Message**
Out of memory.
**Description**
This error code is reported if the memory is insufficient.
**Cause**
This error code is reported if the memory is insufficient.
**Solution**
Check the system memory.
## 2300028 Operation Timeout
**Error Message**
Timeout was reached.
**Description**
This error code is reported if the operation times out.
**Cause**
The TCP connection or the read/write operation times out.
**Solution**
Rectify network faults.
## 2300047 Maximum Redirections Reached
**Error Message**
Number of redirects hit maximum amount.
**Description**
This error code is reported if the number of redirections reaches the maximum.
**Cause**
Redirection is performed too frequently.
**Solution**
Check the server implementation.
## 2300052 No Content Returned by the Server
**Error Message**
Server returned nothing (no headers, no data).
**Description**
This error code is reported if no content is returned by the server.
**Cause**
This problem is probable due to server implementation.
**Solution**
Check the server implementation.
## 2300055 Failed to Send Network Data
**Error Message**
Failed sending data to the peer.
**Description**
This error code is reported if an error occurs while sending network data to the peer end.
**Cause**
This problem is probable due to a network fault.
**Solution**
Rectify network faults.
## 2300056 Failed to Receive Network Data
**Error Message**
Failure when receiving data from the peer.
**Description**
This error code is reported if an error occurs while receiving network data from the peer end.
**Cause**
This problem is probable due to a network fault.
**Solution**
Rectify network faults.
## 2300058 Local SSL Certificate Error
**Error Message**
Problem with the local SSL certificate.
**Description**
This error code is reported if the local SSL certificate is incorrect.
**Cause**
The format of the SSL certificate is incorrect.
**Solution**
Check the format of the SSL certificate.
## 2300059 Failed to Use the Specified SSL Cipher Algorithm
**Error Message**
Couldn't use specified SSL cipher.
**Description**
This error code is reported if the specified SSL cipher algorithm cannot be used.
**Cause**
The system does not support the cipher algorithm negotiated between the client and server.
**Solution**
Capture and analyze packets to check whether the cipher algorithm is supported.
## 2300060 Incorrect SSL Certificate or SSH Key of the Remote Server
**Error Message**
SSL peer certificate or SSH remote key was not OK.
**Description**
This error code is reported if the SSL certificate or SSH key of the remote server is incorrect.
**Cause**
It is probable that the server identity verification fails because the certificate has expired.
**Solution**
Check whether the certificate is valid.
## 2300061 Unrecognized or Incorrect HTTP Encoding Format
**Error Message**
Unrecognized or bad HTTP Content or Transfer-Encoding.
**Description**
This error code is reported if the HTTP encoding format cannot be identified or is incorrect.
**Cause**
The HTTP encoding format is incorrect.
**Solution**
Check the server implementation. Currently, only gzip encoding is supported.
## 2300063 Maximum File Size Exceeded
**Error Message**
Maximum file size exceeded.
**Description**
This error code is reported if the maximum file size is exceeded.
**Cause**
The downloaded file is too large.
**Solution**
Check the server implementation.
## 2300070 Insufficient Server Disk Space
**Error Message**
Remote disk full or allocation exceeded.
**Description**
This error code is reported if the server disk space is insufficient.
**Cause**
The server disk is full.
**Solution**
Check the server disk space.
## 2300073 Uploaded File Already Exists
**Error Message**
Remote file already exists.
**Description**
This error code is reported if the server finds that the uploaded file already exists.
**Cause**
The uploaded file already exists.
**Solution**
Check the server for files that already exist.
## 2300077 No SSL CA Certificate or Access Permission
**Error Message**
Problem with the SSL CA cert (path? access rights?).
**Description**
This error code is reported if the SSL CA certificate does not exist or the access permission is not available.
**Cause**
The SSL CA certificate is not available or the access permission is not granted.
**Solution**
Check whether the SSL CA certificate exists or the access permission is granted.
## 2300078 URL Requested File Not Found
**Error Message**
Remote file not found.
**Description**
This error code is reported if the file requested by the specified URL does not exist.
**Cause**
The file requested by the specified URL does not exist.
**Solution**
Check whether the file requested by the specified URL exists.
## 2300094 Identity Verification Failed
**Error Message**
An authentication function returned an error.
**Description**
This error code is reported if identity verification fails.
**Cause**
The specified identity verification field does not match that on the server.
**Solution**
Check whether the specified identity verification field matches that on the server.
## 2300999 Unknown Error
**Error Message**
Unknown Other Error.
**Description**
This error code is reported if an unknown error occurs.
**Cause**
An unknown error occurs.
**Solution**
Try again or contact technical support.
# Socket Error Codes
## 2301001 Operation Not Allowed
**Error Message**
Operation not permitted.
**Description**
This error code is reported if an operation is not allowed.
**Cause**
The operation is illegal.
**Procedure**
Check the operation procedure.
## 2301002 File Not Exist
**Error Message**
No such file or directory.
**Description**
This error code is reported if the requested file does not exist.
**Cause**
The requested file does not exist.
**Procedure**
Check the file name or file path.
## 2301003 Process Not Exist
**Error Message**
No such process.
**Description**
This error code is reported if a process does not exist.
**Cause**
The process does not exist.
**Procedure**
Check the process information.
## 2301004 System Call Interrupted
**Error Message**
Interrupted system call.
**Description**
This error code is reported if the system call is interrupted.
**Cause**
The system call is interrupted.
**Procedure**
Rectify system call errors.
**Description of TCP/UDP error codes:**
> Mapping format of other TCP/UDP Socket error codes: 2301000 + Linux kernel error code (errno). For details, see Linux kernel error codes.
## 2300002 System Internal Error
**Error Message**
System internal error.
**Description**
This error code is reported if a system internal error occurs.
**Cause**
1. The memory is abnormal.
2. A null pointer is present.
**Procedure**
1. Check whether the memory space is sufficient. If not, clear the memory and try again.
2. Check whether the system is normal. If not, try again later or restart the device.
## 2303104 System Call Interrupted
**Error Message**
Interrupted system call.
**Description**
This error code is reported if the system call is interrupted.
**Cause**
Calling the **connect** function may result in a long blocking time. In such a case, the system generates an interrupt signal and returns an **EINTR** error.
**Procedure**
Call the **connect** function to try network connection again.
## 2303109 Error File Number
**Error Message**
Bad file number.
**Description**
This error code is reported if an operation is performed on a locally closed socket.
**Cause**
The socket FD may be closed.
**Procedure**
Check whether the socket is closed unexpectedly.
## 2303111 Requested Resource Temporarily Unavailable
**Error Message**
Resource temporarily unavailable try again.
**Description**
This error code is reported if the requested system resource is temporarily unavailable.
**Cause**
The system resources are in use.
**Procedure**
Try again later.
## 2303188 Socket Operations on Non-Sockets
**Error Message**
Socket operation on non-socket.
**Description**
This error code is reported if a socket descriptor is not specified for the **socket** parameter.
**Cause**
A socket descriptor is not specified for the **socket** parameter.
**Procedure**
Check whether the descriptor is correctly obtained.
## 2303191 Incorrect Socket Protocol Type
**Error Message**
Protocol wrong type for socket.
**Description**
This error code is reported if the type of the specified socket protocol is incorrect.
**Cause**
The **socket** function is called with an unsupported socket protocol type.
For example, the protocol type cannot be set to **SOCK_STREAM socket** for the the Internet UDP protocol.
**Procedure**
Check whether the socket protocol type is correct.
## 2303198 Network Address Already In Use
**Error Message**
Address already in use.
**Description**
This error code is reported if a network address has been used.
**Cause**
The probable cause can be any of the following: The application attempts to bind a socket to an IP address/port that has been used for an existing socket. The socket is not properly closed. The socket is still being closed.
**Procedure**
Try another network address.
## 2303199 Failed to Assign the Requested Address
**Error Message**
Cannot assign requested address.
**Description**
This error code is reported if the requested address is invalid in its context.
**Cause**
The remote address or port is invalid for the remote server.
**Procedure**
Check whether the address or port is correct.
## 2303210 Connection Timeout
**Error Message**
Connection timed out.
**Description**
This error code is reported if the connection to the remote server cannot be set up for a long time.
**Cause**
It is probable that a server breakdown has occurred.
**Procedure**
Contact the peer end to rectify the fault.
## 2303501 Null SSL
**Error Message**
SSL is null.
**Description**
This error code is reported if the SSL is null.
**Cause**
The returned error information is null when an internal function fails to be executed.
**Procedure**
Call the function again.
## 2303502 TLS Reading Error
**Error Message**
Error in tls reading.
**Description**
This error code is reported if an error occurs while reading data on the TLS socket.
**Cause**
The underlying socket is blocked.
**Procedure**
Perform data receiving again.
## 2303503 TLS Writing Error
**Error Message**
Error in tls writing.
**Description**
This error code is reported if an error occurs while writing data on the TLS socket.
**Cause**
When the send buffer is full, the underlying socket sends an **EWOUDLBLOCK** error, which means that the server does not read the data sent from the client.
**Procedure**
Rectify the fault on the server side.
## 2303504 x509 Failed to Look Up the x509 Certificate
**Error Message**
Error looking up x509.
**Description**
An error occurred when verifying the x509 certificate.
**Cause**
The local certificate does not match the server certificate.
**Procedure**
Check whether the local CA matches the server certificate.
## 2303505 TLS System Call Error
**Error Message**
Error occurred in the tls system call.
**Description**
This error code is reported if the TLS system call fails because of fatal I/O errors.
**Cause**
Network communication fails because of network faults.
**Procedure**
For details, see the Linux kernel error codes (errno).
## 2303506 Failed to Close TLS Connections
**Error Message**
Error clearing tls connection.
**Description**
This error code is reported if the TLS/SSL connection to be closed has been disabled.
**Cause**
The TLS/SSL connection to be closed has been disabled.
**Procedure**
Initiate a new TLS/SSL connection.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册