• 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: Making an NSConnection from a BSD socket
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making an NSConnection from a BSD socket


  • Subject: Re: Making an NSConnection from a BSD socket
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 25 Mar 2004 18:24:10 -0800

On Mar 25, 2004, at 5:39 PM, John Scalo wrote:

I need to set some options on a BSD socket via setsockopt before binding it (otherwise setsockopt has no effect). I then want to use this socket to create an NSConnection. Is there any way to create an NSConnection from a BSD socket rather than an NSSocketPort? Or some way to turn a raw BSD socket into an NSSocketPort after it's created via socket() but before bind() ? The problem with using NSSocketPorts is that when you initialize them, they also get bound so there's no chance to set any socket options.

BTW, the option I'm setting is SO_REUSEPORT so that if the process dies with an active connection, it won't take 10 minutes before a new process can create a new connection with the same port #. It sure would be nice if NSSocketPort had an initWithTCPPort: options: method!

NSSocketPort has an initWithProtocolFamily:socketType:protocol:socket: method. That should qualify as a "way to turn a raw BSD socket into an NSSocketPort".

Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Making an NSConnection from a BSD socket
      • From: John Scalo <email@hidden>
References: 
 >Making an NSConnection from a BSD socket (From: John Scalo <email@hidden>)

  • Prev by Date: Example code using WSMethodInvocationAddSerializationOverride? (WebServicesCore woes)
  • Next by Date: Re: NSTableView
  • Previous by thread: Making an NSConnection from a BSD socket
  • Next by thread: Re: Making an NSConnection from a BSD socket
  • Index(es):
    • Date
    • Thread