WebSocket
WebSocket
WebSocketは、ウェブアプリとサーバー間で双方向接続を維持します。接続が開かれている間、どちら側もメッセージを送信できます。
もう一つの例
2人のチームメイトが1つのボードを編集します。保存した各手は開いた接続を通じて別の画面に到達します。
主な部分
- 01開始ハンドシェイク
- 02レディ状態
- 03受信メッセージ
- 04送信メッセージ
- 05閉じるとアプリの回復
以下の場合に使用します
双方向のメッセージが必要なチャット、コラボレーション、ライブイベントに使用してください。
以下の場合は使用しないでください
時折の単純な読み取りには通常のリクエストを使用してください。WebSocketには組み込みの認証がないため、アプリはアクセスチェックと復旧ルールを追加する必要があります。
コードで使用する名前
CONNECTING -> OPEN <-> messages -> CLOSING -> CLOSED 出荷前に
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome:Complete the task with WebSocket (WebSocket)。 User context:2人のチームメイトが1つのボードを編集します。保存した各手は開いた接続を通じて別の画面に到達します。 Technical concept or control:WebSocket (WebSocket)。 Why it fits:双方向のメッセージが必要なチャット、コラボレーション、ライブイベントに使用してください。 Do not use it when:時折の単純な読み取りには通常のリクエストを使用してください。WebSocketには組み込みの認証がないため、アプリはアクセスチェックと復旧ルールを追加する必要があります。 Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary):この標準は、列挙された範囲のみを対象とします。視覚スタイル、製品の判断、またはVibularyの例は選びません。 Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
このリクエストを確認する
Review how WebSocket (WebSocket) is used now. Definition: WebSocketは、ウェブアプリとサーバー間で双方向接続を維持します。接続が開かれている間、どちら側もメッセージを送信できます。 Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.