Re: Re[2]: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection

Поиск
Список
Период
Сортировка
От kuznet@ms2.inr.ac.ru
Тема Re: Re[2]: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection
Дата
Msg-id 200007051800.WAA11991@ms2.inr.ac.ru
обсуждение исходный текст
Ответ на Re[2]: Fwd: Re: Fwd: Problem with recv syscall on socket when other side closed connection  (Denis Perchine <dyp@perchine.com>)
Список pgsql-hackers
Hello!

> I blamed that: Linux gives you EPIPE when you call recv before all
> data available is retrieved. If you will try to read AFTER error you
> will get all data. Problem is that it makes handling very complicated.
> In the case of EPIPE you should try to read again. The problem is that
> you should always try only once.

Well, to me it does not look very essential, when asynchronous
error returned. Remember about EAGAIN and EINTR yet. You are not confused
with such erros, right? Why? 8)

Seems, this order of issuing errors etc. at read() is specified in posix.
I do not know really. I have said, error reporting only if no data are pending,
looks legal and has its merits. Main thing is not to forget to report error
at all. 8)

[ Alan, seems, all the comments about order of checks while read() are your ones. Can you comment? Maybe, it is really
worthto change.
 
]

Side note: TLI really does not _allow_ any operations on endpoint
in any direction until asynchronous error condition is cleared.
In fact, Linux does this on BSD sockets as well.
This is really natural, but I agree, it is inconvenient yet.

Alexey


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeffery Collins
Дата:
Сообщение: Re: update on TOAST status
Следующее
От: JanWieck@t-online.de (Jan Wieck)
Дата:
Сообщение: Re: Article on MySQL vs. Postgres