Socket: Difference between revisions
Mr. MacKenty (talk | contribs) (Created page with "<center> <blockquote style="padding: 5px; background-color: #FFF8DC; border: solid thin gray;"> File:Exclamation.png This is student work which has not yet been approve...") |
Mr. MacKenty (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
= Sockets = | |||
== Overview == | |||
Sockets are an endpoint for sending and receiving data across a computer network. They enable communication between different processes, either within the same machine or over different machines. Sockets are a key concept in network programming and are used extensively in internet communications. | |||
== | == Types of Sockets == | ||
There are two main types of sockets: | |||
=== Stream Sockets === | |||
* '''Protocol''': Typically use Transmission Control Protocol (TCP). | |||
* '''Characteristics''': | |||
** Connection-oriented. | |||
** Data is read in a continuous stream. | |||
* '''Use Case''': Ideal for scenarios where reliable communication is crucial, like file transfers or sending/receiving messages in chat applications. | |||
=== Datagram Sockets === | |||
* '''Protocol''': Usually employ User Datagram Protocol (UDP). | |||
* '''Characteristics''': | |||
** Connectionless. | |||
== | ** Data is read in chunks (datagrams). | ||
* '''Use Case''': Suited for applications where speed is more critical than reliability, such as online games or streaming services. | |||
* | |||
* | |||
* | |||
* | |||
* | |||
* | |||
Revision as of 22:58, 22 January 2024
Sockets[edit]
Overview[edit]
Sockets are an endpoint for sending and receiving data across a computer network. They enable communication between different processes, either within the same machine or over different machines. Sockets are a key concept in network programming and are used extensively in internet communications.
Types of Sockets[edit]
There are two main types of sockets:
Stream Sockets[edit]
- Protocol: Typically use Transmission Control Protocol (TCP).
- Characteristics:
- Connection-oriented.
- Data is read in a continuous stream.
- Use Case: Ideal for scenarios where reliable communication is crucial, like file transfers or sending/receiving messages in chat applications.
Datagram Sockets[edit]
- Protocol: Usually employ User Datagram Protocol (UDP).
- Characteristics:
- Connectionless.
- Data is read in chunks (datagrams).
- Use Case: Suited for applications where speed is more critical than reliability, such as online games or streaming services.