• 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: CSocket example (was Re: select is not working for me)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CSocket example (was Re: select is not working for me)


  • Subject: Re: CSocket example (was Re: select is not working for me)
  • From: Larry Gerndt <email@hidden>
  • Date: Tue, 21 Oct 2003 22:53:56 -0700

> FYI, for a relatively simple example of how to use select, check out
> the SocketCancel sample code.
>
> http://developer.apple.com/samplecode/Sample_Code/Networking/SocketCancel.htm

Indeed, good advice. I was pointed to this by Quinn the other day and I've
spent the last few days incorporating the above sample code into my project.
I learned a lot from this sample, and I highly recommend it for anyone who
will be using asynchronous (i.e. non-blocking) sockets. It teaches not only
how to use select, but also how to use socketpair. His CSocket "class" (for
Cancelable Socket) creates three sockets, one is the primary I/O socket and
the other two are auxiliary in purpose, created by socketpair, and are used
in conjunction with the select statement to implement a very nice cancel
mechanism such that after cancel, any attempt to write or read the primary
socket will return ECANCELLED.
--
Larry Gerndt
AIM Handle: SonOfTheSonOfMan
Let the truth be told though the heavens fall -- James Garrison
_______________________________________________
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: Setting Network Preferences Programatically
  • Next by Date: URL Access Manager & Proxy Authorization
  • Previous by thread: Re: macnetworkprog digest, Vol 3 #556 - 5 msgs
  • Next by thread: URL Access Manager & Proxy Authorization
  • Index(es):
    • Date
    • Thread