• 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: Too many ports?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Too many ports?


  • Subject: Re: Too many ports?
  • From: Zach Wily <email@hidden>
  • Date: Sat, 1 May 2004 17:16:18 -0600

Yes but my question is should the new sockets have the same port number or a custom new one?

You don't actually create a new socket - you just spin off a thread to handle the incoming connection, then set the socket to listen again (acceptConnectionInBackgroundAndNotify if you're using an NSFileHandle).

zach



On May 1, 2004, at 1:52 AM, j o a r wrote:

The server should listen on just one port, and spin off new sockets when a client connects, while still listening on the same port for new connections. It's standard practice and you could find lot's of sample code on how this is done on the net.

One such example is the sample code that is published with the "Core Mac OS X and Unix Programming" book from BigNerdRanch. They are not using DO, but standard BSD and CF sockets, but the theory is the same - since the underlying technology is the same for all of them.

<http://www.bignerdranch.com/resources/solutions.tgz>

I'm sure that you could find lots of other snippets as well if you only look. Check Apple's sample code, the mailing list archives, Cocoa development web sites and Google.

j o a r

On 2004-05-01, at 08.10, Francisco Tolmasky wrote:

OK, Im using DO over a network with rendezvous, and once a service is discovered, a unique port is chosen for every server/client connection. Is this going overboard? Is it possible to have a unique socket for each connection but not a unique port? Or is this what I should be doing?

Francisco Tolmasky
email@hidden
http://www-scf.usc.edu/~tolmasky/
_______________________________________________
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.
_______________________________________________
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: Too many ports?
      • From: Francisco Tolmasky <email@hidden>
References: 
 >Re: Too many ports? (From: j o a r <email@hidden>)
 >Re: Too many ports? (From: Francisco Tolmasky <email@hidden>)

  • Prev by Date: Re: Cocoa everywhere?
  • Next by Date: Re: Too many ports?
  • Previous by thread: Re: Too many ports?
  • Next by thread: Re: Too many ports?
  • Index(es):
    • Date
    • Thread