Hi folks, When using Netty I know I can specify local port as zero before binding and then after the bindfuture has completed I can read the actual port.
However, I need to know the ephemeral port before the server socket is bound and the system is ready to accept connections. I can get my own ephemeral port manually before binding by opening a ServerSocket like this: ServerSocket s = new ServerSocket(0); int localPort = s.getLocalPort(); However I have to close that port before I can pass the result to Netty to bind the actual socket, but that means there's a race condition where something else can get the port assigned between it being closed and Netty creating its ServerSocket. Any thoughts on how I can resolve this? -- You received this message because you are subscribed to the Google Groups "Netty discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/netty/75f8769b-11c6-47b0-9028-1cf38580e68bn%40googlegroups.com.
