Hi Felix, this looks good in general.
I would, however, suggest to rename the method 'recreateServerSocket' into ' createServerSocket' as the former name suggests that something which existed once was recreated. But in this case the socket is simply created with a few retries when exceptions occur. I'd also prefer if the retry count could be stored in a static field to allow for easy modification, instead of literally coding it to the value of 5 in the method. And a minor thing: in line 63 there's a blank in between "recreateServerSocket" and "(int serverPort)" which should be removed. Best regards Christoph > -----Original Message----- > From: net-dev [mailto:net-dev-boun...@openjdk.java.net] On Behalf Of > Felix Yang > Sent: Mittwoch, 6. September 2017 10:06 > To: net-dev@openjdk.java.net; Mark Sheppard > <mark.shepp...@oracle.com> > Subject: RFR 8085875/10, java/net/DatagramSocket/PortUnreachable.java > fails intermittently: Address already in use > > Hi all, > > please review a patch to add retries to avoid possible port > conflicts during re-binding. > > Bug: > > https://bugs.openjdk.java.net/browse/JDK-8085875 > > Webrev: > > http://cr.openjdk.java.net/~xiaofeya/8085875/webrev.00/ > > Thanks, > > Felix