History log of /libcore/luni/src/test/java/libcore/java/nio/channels/ServerSocketChannelTest.java
Revision Date Author Comments
914e18679c117b646c267f5e1e50d8f5810df1b2 06-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Fix ServerSocketChannelTest#setOption

For SO_RCVBUF, if the value is less than the allowed minimum, it sets
the value to the minimum, otherwise, keeps the value as is.

Bug: 28024647
Change-Id: I7cba2d99921b19d4d37e4588a4d5879ad3d856f3
e5f08c57bc21f73466326ac0f505ef34d3a362de 01-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Add Unit Tests

Unit test added for:
DatagramChannel.bind(java.net.SocketAddress)
DatagramChannel.getRemoteAddress()
ServerSocketChannel.bind(java.net.SocketAddress, int)
ServerSocketChannel.bind(java.net.SocketAddress)
ServerSocketChannel.setOption(java.net.SocketOption, T)
SocketChannel.bind(java.net.SocketAddress)
SocketChannel.getRemoteAddress(java.nio.channels)
SocketChannel.shutdownInput()
SocketChannel.shutdownOutput()

Bug: 27466931
Change-Id: I0004329d71b1ce113d8dd6d9b72fa0f630d7b060
0aff1dd0b4be1b8d8cb45b59079ca883a1b3205a 17-Jun-2014 Elliott Hughes <enh@google.com> Remove.

(cherry-pick of 63744c884dd4b4f4307f2b021fb894af164972af.)

Change-Id: Ibf79a402e1bad98a262e380fcee3d35c127ae6d5
63744c884dd4b4f4307f2b021fb894af164972af 17-Jun-2014 Elliott Hughes <enh@google.com> Remove.

Change-Id: Ibf79a402e1bad98a262e380fcee3d35c127ae6d5
df29508a7aa622f265aaebdc472eb7d679185ebb 30-Jan-2014 Neil Fuller <nfuller@google.com> Implementation of MulticastChannel.

Note: ProtocolFamily / StandardProtocolFamily /
DatagramChannel.open(ProtocolFamily) have not been
implemented.

There is a related change to libnativehelper that
must be merged at the same time to avoid
build breakage. See
https://android-review.googlesource.com/#/c/81371/

Bug: 12464155
Change-Id: I07fc049b429a2d373e9bd7b07149632f5cd69f9d
ff81b740a338ba964e0ba1c40d925fb2ceb37bf2 20-Jan-2014 Neil Fuller <nfuller@google.com> Adding additional methods to NetworkChannel.

Adding NetworkChannel.supportedOptions(), NetworkChannel.getOption(),
NetworkChannel.setOption(). A lot of the changes are in documentation
and tests.

Bug: 12464155
Change-Id: Ifa56843a8823b6b9cbd262409adc2450b401c654
47ae0b5a1d96c8030e0963ccc5b44c3ee66aaec3 20-Jan-2014 Neil Fuller <nfuller@google.com> Implementing bind() and getLocalAddress() for NIO2.

This change introduces NetworkChannel, but only bind() and
getLocalAddress() methods. To avoid breaking existing Android
applications that extend ServerSocketChannel, DatagramChannel and
SocketChannel the methods have been added with concrete
implementations that throw exceptions rather than leaving them
abstract.

In channel tests, usages of channel.socket().bind() and
channel.socket().getLocalSocketAddress() have been changed to
channel.bind() and channel.getLocalAddress(), since the behavior is
close enough and the tests should be written against the channel APIs
as much as possible. Tests have been added for new methods.

Removed further overriding in
DatagramChannelImpl.DatagramSocketAdapter and
SocketChannelImpl.SocketAdapter which revealed some bugs and lack of
clarity in the docs for the socket methods:

Improved the documentation for DatagramSocket.getLocalAddress(),
DatagramSocket.getLocalSocketAddress(),
ServerSocket.getInetAddress(), ServerSocket.getLocalPort(),
ServerSocket.getLocalSocketAddress(), Socket.getLocalAddress(),
Socket.getLocalPort(), Socket.getLocalSocketAddress(). These methods
treat special cases differently.

Fixed a bug in DatagramSocket.getLocalSocketAddress() where it would
incorrect throw an exception if the socket has been closed, which
contradicts the (updated) documentation and the RI. It now returns
null. Added tests.

Fixed a bug in Socket.close(): a closed socket would still report as
being connected. Added tests.

Fixed a bug in Socket.startupSocket() - the socket was recording it
was being bound, but was not updating the cached local address. This
method is called during ServerSocketChannel.accept() and would cause
the socket to report its local address as being the wildcard address,
when it is not. Added a test.

Change-Id: Ibec8527e1c72597e268d23e6c1f03eb16e46cdc4
Bug: 12464155
a3b57e9cb41fb00ac607cd330fa73270b564b66c 06-May-2011 Elliott Hughes <enh@google.com> Fix non-blocking DatagramChannel.receive and ServerSocketChannel.accept.

The former problem was the reported bug, but the latter was another instance of
the same mistake, and much harder to fix.

The interesting change here is that we now create the SocketImpl (and thus the
underlying OS socket) for a ServerSocket much sooner than we used to: if the
constructor doesn't throw, you've got yourself a usable socket.

Bug: http://code.google.com/p/android/issues/detail?id=16579
Change-Id: Iac8b707e74cd1367ee0fdc22fc3969677cfa566c