Re: Legacy OpenTransport problem
Re: Legacy OpenTransport problem
- Subject: Re: Legacy OpenTransport problem
- From: Zachary and Meagan <email@hidden>
- Date: Tue, 18 Jul 2006 12:54:45 -0700
I looked over the code and I am discarding the port that passed in at
the receive function. I just assumed the port is the same as when the
connection is made. I am going to modify the code and see if that
helps. Thanks so much for the help!
On Jul 18, 2006, at 12:13 PM, james woodyatt wrote:
On Jul 18, 2006, at 11:56, Zachary and Meagan wrote:
// -- specify a recipt buffer
data.addr.maxlen = sizeof(InetAddress);
data.addr.len = sizeof(InetAddress);
data.addr.buf = (UInt8*)&from;
data.opt.maxlen = 0;
data.opt.len = 0;
data.opt.buf = 0;
data.udata.maxlen = maxPacketDataSize;
data.udata.len = 0;
data.udata.buf = (UInt8*)packet->data;
// -- receive a packet
result = OTRcvUData( endpoint, &data, &flags );
if (result == kOTNoError)
{
// -- get the address that the packet came from
packet->address.host = from.fHost; ***** HERE IS THE
ADDRESS I USE *****
packet->address.port = from.fPort;
...
I think you might not be reading the whole destination address. Is
'InetAddress' an Internet domain socket address, with IP address
and port? Or is it just an IP address?
When the AirPort Base Station translates the source address of the
client's packet from local routing realm to the public routing
realm, it will also change the UDP port. You need to send the
server's reply to the port chosen by the AirPort Base Station, not
the port chosen by the client or specified by your protocol.
Another important consideration: when the AirPort Base Station sees
the first packet from the client to the server, it will create a
translation record in its memory that will need to be there for
packets to be forwarded from the server to the client (a similar
thing needs to happen in the Linksys router, too, but that's
probably not relevant here). If this translation record isn't used
periodically (the time interval is short, usually measured in
seconds, not minutes) then it will be erased and subsequent packets
from the server to the client will be discarded without ICMP errors.
--
james woodyatt <email@hidden>
member of technical staff
apple computer, inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden