SOCK_STREAM VS SOCK_SEQPACKET

network-programming, sockets

Solution

full-duplex means that it is capable of simultaneous communication for sending and receiving data.

The manual is misleading here though; socket types make no guarantee on the efficiency of the communication, but merely what sorts of operations may be performed on them.

From my `socket(2)` manpage:

   SOCK_STREAM     Provides sequenced, reliable, two-way, connection-based byte streams.  An out-of-band  data  transmission
                   mechanism may be supported.

   SOCK_SEQPACKET  Provides  a  sequenced,  reliable, two-way connection-based data transmission path for datagrams of fixed
                   maximum length; a consumer is required to read an entire packet with each input system call.

Problem

I have read from the PHP manual the definitions of those two types of communications but really I am facing a problem in understanding some paragraphs so I need your help. those tow definitions are for PHP manual: SOCK_STREAM Provides sequenced, reliable, full-duplex, connection-based byte streams. An out-of-band data transmission mechanism may be supported. The TCP protocol is based on this socket type. SOCK_SEQPACKET Provides a sequenced, reliable, two-way connection-based data transmission path for datagrams of fixed maximum length; a consumer is required to read an entire packet with each read call. but really I cant understand why it used the words full-duplex, connection-based byte streams and two-way connection-based data transmission path for datagrams of fixed maximum length and really I do not know what is the difference between the two-way connection and the full-duplex connection. I am a little confused so I need your help. Thanks every body.

Original source