United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6621689 (dc spec) DatagramChannel.receive when channel is not bound is not specified
JDK-6621689 : (dc spec) DatagramChannel.receive when channel is not bound is not specified

Details
Type:
Bug
Submit Date:
2007-10-25
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-04-11
Component:
core-libs
OS:
generic
Sub-Component:
java.nio
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports

Sub Tasks

Description
The DatagramChannel.receive method does not specify the behavior when the channel is not bound. Since 1.4, our implementation has returned null, even for the blocking case. Throw NotNotBoundException or explicitly binding the channel's socket might have been better choices but it cannot now be changed.

A related issue is that the adaptor emulation of DatagramSocket.receive is not correct. Legacy DatagramSocket binds the socket if not already bound so the adaptor should be updated to do the same.

                                    

Comments
EVALUATION

Also, the receive and connect methods do not specify the required behavior for when the channel's socket is not bound. In both cases, the implementation will implicitly bind the socket and this is reasonable behavior to expect.
                                     
2007-11-20



Hardware and Software, Engineered to Work Together