sockets

クライアントとサーバー間のリアルタイム双方向通信のためのプロトコル。

WebSocketHTTPとは異なります。HTTPは要求応答ベースですが、WebSocketはデータが双方向に同時に流れる永続的な接続を可能にします。チャット、ゲーム、ライブアップデートなどを必要とするアプリに最適です。

        graph LR
  Center["sockets"]:::main
  Rel_network_latency["network-latency"]:::related -.-> Center
  click Rel_network_latency "/terms/network-latency"
  Rel_internet_of_things_iot["internet-of-things-iot"]:::related -.-> Center
  click Rel_internet_of_things_iot "/terms/internet-of-things-iot"
  Rel_encryption_in_transit["encryption-in-transit"]:::related -.-> Center
  click Rel_encryption_in_transit "/terms/encryption-in-transit"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧠 理解度チェック

1 / 1

🧒 5歳でもわかるように説明

A socket is like an electrical outlet for data. If you want your vacuum cleaner (your program) to work, you have to plug it into the wall (the socket). One end is on your computer, and the other end is on the server you are talking to.

🤓 Expert Deep Dive

Unix Sockets provide high-performance IPC on the same host, while Network Sockets (INET) use the TCP/IP stack. The 'Berkeley Sockets' API is the de-facto standard. Socket options like SO_REUSEADDR and TCP_NODELAY allow developers to fine-tune network behavior for performance and latency.

📚 出典