Re: Networking problem with OpenPlay
Re: Networking problem with OpenPlay
- Subject: Re: Networking problem with OpenPlay
- From: "Matt Slot" <email@hidden>
- Date: Tue, 4 Mar 2003 22:57:46 -0500
Bryan Pietrzak (email@hidden) wrote:
>
binding to any port; result: 0; returned port 49153
>
binding; requesting port 49153; result: -3247; returned port 0
>
EP: 0x05127c98 (state: T_UNBND), OTError for OTBind: kEADDRINUSEErr
>
(-3247). File: OTIPEndpoint.cpp, 186
I glanced at the code, but my recollection is that NSp/OP uses both a
datagram and stream endpoint. It looks like you are letting OTBind()
pick the UDP port, then trying to bind to the same TCP port -- and
that port is already being used.
Most operating systems start picking "random" ports at the same value,
so it's very possible to have some overlap between UDP and TCP ports.
Under OS9, it's probably not such a big deal -- few programs leave an
open endpoint for a long time. Under OSX, there are alot more servers
and clients -- and it's easier to leave them running in the background.
You can use 'netstat' from the command line to see what ports are in
use.
My suggestion is to generate your own "random" port numbers -- pick a
safe range (say 25000-26000, or whatever) that will reduce collisions
with other services.
Matt
/* Matt Slot, Bitwise Operator * <
http://www.ambrosiasw.com/~fprefect/> */
/* "I never let schooling interfere with my education." -- Mark Twain */
_______________________________________________
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.