Skip to content

Commit 9437962

Browse files
committed
Update ping.md
1 parent eb35709 commit 9437962

File tree

1 file changed

+19
-11
lines changed
  • docs/specification/basic/utilities

1 file changed

+19
-11
lines changed

docs/specification/basic/utilities/ping.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@ A ping request is a standard JSON-RPC request with no parameters:
2727

2828
## Behavior Requirements
2929

30-
1. The receiver MUST respond promptly to ping requests
31-
2. If no response is received within a reasonable timeout period, the sender MAY:
30+
1. The receiver **MUST** respond promptly with an empty response:
31+
32+
```json
33+
{
34+
"jsonrpc": "2.0",
35+
"id": "123",
36+
"result": {}
37+
}
38+
```
39+
40+
2. If no response is received within a reasonable timeout period, the sender **MAY**:
3241
- Consider the connection stale
3342
- Terminate the connection
3443
- Attempt reconnection procedures
@@ -41,19 +50,18 @@ sequenceDiagram
4150
participant Receiver
4251
4352
Sender->>Receiver: ping request
44-
Note over Receiver: Process immediately
45-
Receiver->>Sender: response
53+
Receiver->>Sender: empty response
4654
```
4755

4856
## Implementation Considerations
4957

50-
- Implementations SHOULD use pings to detect connection health
51-
- The frequency of pings SHOULD be configurable
52-
- Timeouts SHOULD be appropriate for the network environment
53-
- Excessive pinging SHOULD be avoided to reduce network overhead
58+
- Implementations **SHOULD** periodically issue pings to detect connection health
59+
- The frequency of pings **SHOULD** be configurable
60+
- Timeouts **SHOULD** be appropriate for the network environment
61+
- Excessive pinging **SHOULD** be avoided to reduce network overhead
5462

5563
## Error Handling
5664

57-
- Timeouts SHOULD be treated as connection failures
58-
- Multiple failed pings MAY trigger connection reset
59-
- Implementation SHOULD log ping failures for diagnostics
65+
- Timeouts **SHOULD** be treated as connection failures
66+
- Multiple failed pings **MAY** trigger connection reset
67+
- Implementations **SHOULD** log ping failures for diagnostics

0 commit comments

Comments
 (0)