• 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: newbie OT UDP question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie OT UDP question


  • Subject: Re: newbie OT UDP question
  • From: Quinn <email@hidden>
  • Date: Thu, 27 Mar 2003 10:31:16 +0000

At 23:37 -0800 26/3/03, Larry Abel wrote:
Do I need to create a TEndpoint for the OTSndUData and another for the OTRcvUData or can I use the same TEndpoint for sending and receiving?

I presume you mean "does my *client* need to create an endpoint for send and another for receive?" Obviously you'll need different endpoints in your client and your server (-:

The answer to /that/ question is "no". In your client you can and should use a single endpoint for the send and receive. You should bind the endpoint using OTBind(ep, NULL, NULL). Your client will thus be bound to an anonymous UDP port (port number of 49152 or above). When you send, the UDP message will have your machine's IP address as its source address and that anonymous port number as its source port. When the server receives the message, it can get this information by setting up the udata.addr.maxlen and udata.addr.len fields when it calls OTRcvUData. It then use that source address and port as the destination address and port for its reply.

If you use a separate endpoint for send and receive, this doesn't work as nicely.

S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
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: newbie OT UDP question
      • From: Larry Abel <email@hidden>
References: 
 >newbie OT UDP question (From: Larry Abel <email@hidden>)

  • Prev by Date: Re: timing out an OTSnd
  • Next by Date: Re: Stop listening!
  • Previous by thread: newbie OT UDP question
  • Next by thread: Re: newbie OT UDP question
  • Index(es):
    • Date
    • Thread