Re: socket write gets stuck
Re: socket write gets stuck
- Subject: Re: socket write gets stuck
- From: Tom Bayley <email@hidden>
- Date: Thu, 20 Mar 2003 10:14:47 +0000
On Thursday, March 20, 2003, at 05:47 am, Larry Gerndt wrote:
I'm not sure exactly what was going on at the server side of this
socket, he
said something like: "I accidently set the read thread's timeout to
zero
thinking that would be infinite, but it was really zero." (sorry but I
don't know more than that). Anyway, if I attempt to write a large
chunk of
data to the socket when it's in that condition, it gets stuck (and
stays
stuck). For some reason smaller chunks are ok.
Possibly the server is not reading at all? When you send small chunks
they get buffered at the client, but past a certain point the write
must block.
implement a time-out on write(). So I set up a 5-second timeout on
write()
via a call to setsocketopt(). No timeout ever occurs. This bug is
like a
rock that I can't so much as budge. Does anyone have any insight to
share?
I can't explain that as I haven't used these options. The way I
implement write timeouts is this: My sockets are all non-blocking. If I
get a "would block" error from my write I then wait on select() until
the socket is writable. select() of course allows you to specify a
timeout.
Tom
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.