• 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: Quinn <email@hidden>
  • Date: Mon, 4 Feb 2002 19:24:26 +0000

At 11:00 -0800 4/2/02, Duane Murphy wrote:
I am curious about this comment (bletch). I am new to unix network
programming and this seemed to be a fairly powerful non-blocking way of
dealing with sockets.

What am I missing?

"bletch" is my own personal bias. Sorry.

However, non-blocking sockets and select do have a number of problems that aren't the result of my bias.

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.

o select just returns when something happens--it doesn't tell you what happened. So you have to walk each of your fd_set's (these are parameters to select, type "man select" in Terminal for the gory details) looking for the ones that fired. For large fd_sets this can be slow.

o select results in a programming model just like OT notifiers: everything has to be a state machine. Having grown up on the Mac I don't mind this programming model--it actually feels kinda normal--but I've debugged enough developer code to convince me that not everyone else feels the same way.

If you're new to UNIX network programming I highly recommend "UNIX Network Programming" (ISBN: 013490012X) by Stevens. This is one of the best programming books I've ever read on any topic.

<http://www.amazon.com/exec/obidos/ASIN/013490012X/qid=1012850481/
sr=8-2/ref=sr_8_71_2/002-9091064-8801624>

S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware


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

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