• 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: Issues with select
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues with select


  • Subject: Re: Issues with select
  • From: Aaron Ballman <email@hidden>
  • Date: Fri, 30 Apr 2004 11:53:15 -0500

It's one of those great BSD sockets API design 'features'. For non-blocking connects, select makes the socket writable when the connection attempt is done. You then have to do something else to see whether it was successful. The standard trick is to call getpeername.

Oh goodie! ;-) After putting that check in, everything works as expected again. Thanks for pointing that out!

Curiously, I've heard tell that at least some versions of Windows do this correctly. That is, you can an error flag from select when the connection fails. Be careful of this if you're writing cross platform sockets code.

Thanks for the heads up.

~Aaron
--
In response to a stupid question I once asked: "My brain uses patterns to format responses to your inputs, but I don't have one for that. Do you speak German?" ~ Zola
_______________________________________________
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.


  • Prev by Date: Re: Temporarily setting DNS servers
  • Next by Date: Re: Issues with select
  • Previous by thread: Re: Issues with select
  • Next by thread: Calling a helper tool from Java code
  • Index(es):
    • Date
    • Thread