Re: newbie OT UDP question
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.