RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

Pavel Rappo pavel.rappo at oracle.com
Tue May 27 10:05:49 UTC 2014


Michael,

java.net.ServerSocket.accept:

    if (!isBound())
        throw new SocketException("Socket is not bound yet");

sun.nio.ch.ServerSocketAdaptor.accept will translate java.nio.channels.NotYetBoundException into an instance of SocketException with the text you see above. Basically that's what the attached test verifies.

-Pavel

On 27 May 2014, at 10:49, Michael McMahon <michael.x.mcmahon at oracle.com> wrote:

> On 27/05/14 10:40, Pavel Rappo wrote:
>> Hi everyone,
>> 
>> Could you please review my change for JDK-8024832?
>> 
>> http://cr.openjdk.java.net/~prappo/8024832/webrev.00/
>> 
>> Thanks
>> -Pavel
> 
> Just wondering, what does ServerSocket.accept() throw in the same situation?
> 
> Michael



More information about the net-dev mailing list