RE: SOCK_STREAM and EPOLLET

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Simon Arlott
> Sent: 20 August 2017 17:37
> According to epoll(7):
>        Q9  Do I need to continuously read/write a file descriptor until
>            EAGAIN when using the EPOLLET flag (edge-triggered behavior) ?
> 
>        A9  For  stream-oriented files (e.g., pipe, FIFO, stream socket),
>            the condition that the read/write I/O space is exhausted can
>            also be detected by checking the amount of data read from /
>            written to the target file descriptor.
> 
> However, if the remote end of a socket(PF_INET6, SOCK_STREAM,
> IPPROTO_SCTP) is making multiple send() calls with 1 byte of data (and
> has NODELAY enabled), then a recv() call only returns 1 byte of data at
> a time even if there is more data available.
> 
> I'd expect a stream socket to return all the available data. Either the
> behaviour of recv() is wrong or the advice in epoll(7) is incorrect for
> SCTP sockets.

SCTP is message oriented, each send() generates a separate message and
each recv() returns a single message.
NDODELAY isn't relevant. If you do 100 send() you'll need 100 recv().

	David

��.n��������+%������w��{.n�����{������ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux