• 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
CFSocket completeness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFSocket completeness


  • Subject: CFSocket completeness
  • From: Eric Lengyel <email@hidden>
  • Date: Fri, 13 Feb 2004 04:55:26 -0800

Hi --

I've been converting some old OpenTransport code to CFSocket lately (for a multiplayer game), and it seems that there are a few things missing. I wanted to run it by you guys to see if I was missing anything. I have three issues:

1) CFSocket includes a function CFSocketSendData(), but does not include a complementary CFSocketReceiveData() function. I've been able to receive data on a run loop by listening for the kCFSocketDataCallBack type, but this requires going through the run loop once for every datagram received when UDP is being used. It'd be nice to be able to listen for the kCFSocketReadCallBack type and then repeatedly call a function like CFSocketReceiveData() to get all of the available datagrams. In the case that I'm listening on the socket in a separate thread, this would be more efficient because I wouldn't have to release and re-acquire mutexes for every message. Can anybody give me a more symmetric way of doing things here?

2) CFSocket doesn't provide any access to socket options, so I have to get the native socket handle and call setsockopt(). Kinda goes against the whole encapsulation thing, but not a big deal. Is there anything better than this?

3) Another nit-picky issue about encapsulation: CFSocket doesn't abstract addresses at all, and we're still stuck looking at the ugly UNIX-style sockaddr and sockaddr_in structures. Am I wrong?

Thanks for any info you can provide.

-- Eric Lengyel
_______________________________________________
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.

  • Follow-Ups:
    • Re: CFSocket completeness
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Internet Config: Mac OS X 10.3 issue
  • Next by Date: Re: UDP broadcast address
  • Previous by thread: Re: Internet Config: Mac OS X 10.3 issue
  • Next by thread: Re: CFSocket completeness
  • Index(es):
    • Date
    • Thread