legacy code and OT random source port
legacy code and OT random source port
- Subject: legacy code and OT random source port
- From: "Melissa Graesser" <email@hidden>
- Date: Wed, 9 Jun 2004 09:50:19 -0600
- Organization: Vertis, Inc.
We have a legacy product that is using OT and endpoints. It connects to a
windows service on a NT server box on a specific port. We used to specify
the source port but have run into problem with one of our customers when
they switched to new networking software and load balancing. The server
does not send a reset so even after we close the port it is not free
until it times out on the server which is 4 minutes. We have changed the
code to get a random number for the source port using ::OTGetRandomNumber
(&seed, 49152, 65535) for OS 9, and use that when we init using
OTInitInetAddress and the bind using TEndpoint.
This works fine on OS 9, but for OS X these calls are not available. I
also do not think it is valid to specify a source port but if I pass zero
in as the port for OTInitInetAddress and then bind it will give me a
unique port each time I call the bind using TEndpoint::Bind(TBind*
reqAddr, TBind* retAddr) in the receiving InetAddress structure but this
is not bound correctly because from the technotes I have read the
requested port is suppose to equal the received port in the InetAddress
structure. Do you know the correct way to get a unique source port for OS
X open transport. I do not want to use bsd sockets because the
application is going to be replaced with a web application soon and it
has a short life expectancy.
Thanks,
Melissa
_______________________________________________
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.