Re: select() and write()

2002-07-12 Thread LS
>You set a socket fd to nonblocking with: >fcntl(fd, F_SETFL, O_NONBLOCK); > IMHO this is NOT the right way to set non-blocking IO, you are overwriting any other socket flags. Consider the following code: rc = fcntl( fd, F_GETFL, 0); if ( rc != -1) fcntl( fd, F_SETFL, rc | O_NONBLOCK); e

Re: select() and write()

2002-07-11 Thread guy keren
On 11 Jul 2002, Gilad Ben-Yossef wrote: > That's it. The descriptor did change status but you gave write a bigger > byte then it can chew, so to speak. It promised you can write, but > didn't say how much. > > If you don't want to block, request non blocking IO. or use some API to check how muc

Re: select() and write()

2002-07-11 Thread Nadav Har'El
On Thu, Jul 11, 2002, Alex Shnitman wrote about "select() and write()": > Hi, > > I'm using select() before write() to a TCP socket, in order to be sure > that I won't block on the write() if the other end's network connection > has broke. However, I found

Re: select() and write()

2002-07-11 Thread Gilad Ben-Yossef
On Thu, 2002-07-11 at 19:12, Alex Shnitman wrote: > Hi, > > I'm using select() before write() to a TCP socket, in order to be sure > that I won't block on the write() if the other end's network connection > has broke. However, I found out that if I pass a buffer bigger than ~50k > to write(), it

select() and write()

2002-07-11 Thread Alex Shnitman
Hi, I'm using select() before write() to a TCP socket, in order to be sure that I won't block on the write() if the other end's network connection has broke. However, I found out that if I pass a buffer bigger than ~50k to write(), it will block anyway! Any idea what's up with that? write()s to a