Jean Tourrilhes <[EMAIL PROTECTED]> writes:
> To use this service, just replace SOCK_STREAM by
> SOCK_SEQPACKET in your application. As opposed to UDP, this is a
Very nice Jean, but I think we should do things a bit different:
SOCK_STREAM
Provides sequenced, reliable, two-way connection-
based byte streams. An out-of-band data transmis-
sion mechanism may be supported.
SOCK_DGRAM
Supports datagrams (connectionless, unreliable mes-
sages of a fixed maximum length).
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 system call.
So SOCK_SEQPACKET should be used for reliable TTP connections with SAR
(segmentation and reassembly) enabled (where message boundaries are
preserved), while SOCK_STREAM is for TTP connections with SAR disabled (and
where message boundaries _may_ not be preserved.
I think you should probably use SOCK_DGRAM for unitdata (udata)
transfer. The unitdata service you are using is however an unreliable
service _within_ a connection, so it may conflict with ultra which is
unreliable tranfer _outside_ a connection (9600 bps only)
Anyway, TTP with SAR enabled _is_ a sequenced packet service, so we must
use SOCK_SEQPACKET for this service. I feel that we should probably use an
ioctl to differ between a unitdata or ultra for a SOCK_DGRAM socket.
PS. And yes, I was a bit confused myself when I used SOCK_STREAM for both
SAR enabled, and SAR disabled TTP connections. I discovered this some time
ago, and have plans to remove this "feature", so SOCK_STREAM sockets will
only have a max SDU size of 0. Then we should only allow the MAX_SDU_SIZE
ioctl for SOCK_SEQPACKET sockets to limit the SDU size for incomming TTP
segments.
-- Dag
--
/ Dag Brattli | The Linux-IrDA Project /
// University of Tromsoe, Norway | Infrared communication for Linux //
/// http://www.cs.uit.no/~dagb | http://www.cs.uit.no/linux-irda/ ///
_______________________________________________
Linux-IrDA mailing list - [EMAIL PROTECTED]
http://www4.pasta.cs.UiT.No/mailman/listinfo/linux-irda