0

From this post What's the difference between streams and datagrams in network programming?, the 2nd answer says:

Stream Socket:
Dedicated & point-to-point channel between server and client.
...
Datagram Socket:
No dedicated & point-to-point channel between server and client.
...

What is the point-to-point channel described here ? Why stream socket is point to point while datagram is not?

Rick
  • 7,007
  • 2
  • 49
  • 79

1 Answers1

1

A stream socket provides a connection between two endpoints. Point to point channel means usually a TCP connection. A connection is established before user data is sent and the connection is released later. The connection has always two end points and data can be transferred between these end points.

A datagram socket can be used for communication with multiple peers. It is usually used for communication over UDP. A datagram socket is not bound to any remote peer and it is possible to receive data from multiple peers through a single datagram socket. It is even possible to send data to multiple peers through a datagram socket when destination address is a broadcast or multicast address.

Zaboj Campula
  • 3,155
  • 3
  • 24
  • 42