• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: socket write gets stuck
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >socket write gets stuck (From: Larry Gerndt <email@hidden>)

  • Prev by Date: Re: Multiprocessor problem?
  • Next by Date: Re: Multiprocessor problem?
  • Previous by thread: Re: socket write gets stuck
  • Next by thread: Re: socket write gets stuck (SOLVED)
  • Index(es):
    • Date
    • Thread