Re: In which case write() will be blocked
- From: "David Schwartz" <davids@xxxxxxxxxxxxx>
- Date: 30 Oct 2006 21:15:33 -0800
Binary wrote:
Hi DS,
Do you know which reason will cause this problem?
How can I know
whether the peer is not fast enough to read the buffer and is there a
place to check the buffer status?
The problem is in a server daemon, which has many client, if the
problem occur, the only info is the fd number.
ABAI
The problem is almost certainly that the server absolutely cannot
afford to block, but does not tell the kernel this by setting the
socket non-blocking. If you absolutely, positively cannot block, you
must never ever make a call that can be blocked indefinitely. A 'write'
or 'read' to a connection over the network can block indefinitely.
(Even if you 'select' first.)
DS
.
- Follow-Ups:
- Re: In which case write() will be blocked
- From: Binary
- Re: In which case write() will be blocked
- References:
- In which case write() will be blocked
- From: Binary
- Re: In which case write() will be blocked
- From: Måns Rullgård
- Re: In which case write() will be blocked
- From: David Schwartz
- Re: In which case write() will be blocked
- From: Binary
- In which case write() will be blocked
- Prev by Date: Re: Advanced c++ debugging techniques on Unix
- Next by Date: Re: In which case write() will be blocked
- Previous by thread: Re: In which case write() will be blocked
- Next by thread: Re: In which case write() will be blocked
- Index(es):
Relevant Pages
|
|