Andrew Zhang wrote: > On 4/18/07, LvJimmy,Jing <[EMAIL PROTECTED]> wrote: >> >> This method is good, but not perfect, for >> 1. getNextPortsForUDP get a free port by a mechanism "get and >> release", but release the port may not be successful (e.g, in linux) >> > 2. even it releases successfully, during the period between utility >> method "release" and serversocket reuse it, there may be some other >> program reuse the port, which cause the test fail again. > > > Open and close is not safe in theory, as we discussed before. > Let's stop getNextPort, and stick to use port 0. :) I think we have agreed > that a long time ago.
Yes. > 3. this may cost much more time to get a port. >> > The perfect solution for this is re-write the testcases, create >> ServerSocket with port 0, and then get the local port for socket to >> connect. However I guess it may cause a lot of affect. > > > yes, but we can do it lazily and gradually. The important thing is that we > should not use the buggy getNextPort any more.... I agree, how about we mark it @deprecated to help remind people? Regards, Tim
