• 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: Network Programming Models (was OTCountFreeBytes?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Network Programming Models (was OTCountFreeBytes?)


  • Subject: Re: Network Programming Models (was OTCountFreeBytes?)
  • From: Becky Willrich <email@hidden>
  • Date: Mon, 4 Feb 2002 11:43:41 -0800

o You can only select on a limited number of file descriptors simultaneously. This limit, FD_SETSIZE, is currently 1024, which is way too limiting for a serious server product.

This is actually a limitation of the FD_SET macros; the actual functions don't have this limitation, so you can workaround by implementing your own bit-flag sets (which would have to dynamically reallocate as more sockets were added to the set). You can check out a recent implementation of CFSocket in Darwin for an example of how to do this. That said, I must agree that the bit-flag approach is not the nicest.

I will add my own pet-peeve about select, which is that it's a pain to interrupt in any fashion. The normal trick to deal with this is to open a socket to yourself (and then add that socket to the read set going in to select), so that you can force the select to return by writing in to the socket.

REW


  • Follow-Ups:
    • Re: Network Programming Models (was OTCountFreeBytes?)
      • From: email@hidden
References: 
 >Re: Network Programming Models (was OTCountFreeBytes?) (From: Quinn <email@hidden>)

  • Prev by Date: Re: Threads vs Select (was Re: Re(2): [Repost] OTCountFreeBytes? (like OTCountDataBytes but for send))
  • Next by Date: Re: Network Programming Models (was OTCountFreeBytes?)
  • Previous by thread: Re: Network Programming Models (was OTCountFreeBytes?)
  • Next by thread: Re: Network Programming Models (was OTCountFreeBytes?)
  • Index(es):
    • Date
    • Thread