summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2016-12-14 13:51:14 +0000
committerYi Kong <yikong@google.com>2016-12-22 14:43:57 +0000
commit5e0df13532a902abc72c267a92bf3d83e71b0b1c (patch)
treed954ab5ee34635bec5e43fd17265cb38d3c5f45c /annotations/generate_annotated_java_files.py
parent6205f0085bca6a0b0d503d8d8dfc172e6a9e1b1b (diff)
Move PlainDatagramSocketImpl away from JNI (part 1)
Rewrites all JNI methods in PlainDatagramSocketImpl apart from socket{Get,Set}Option on top of IoBridge. There are some differences comparing to JNI code: bind: * We don't set setDefaultScopeID, since that's not necessary for Linux. send: * OpenJDK sets sin6_flowinfo field, but this is against RFC3493 and is not used by the kernel. We don't set this field. peek: * Temporary DatagramPacket object has zero length instead of one in original implementation. These is no need to have that one byte and has better performance by avoid allocating a buffer. datagramSocketCreate: * We don't need to explicitly setsockopt IP_MULTICAST_ALL to 0, as this is default for AF_INET6 sockets and we always create sockets with AF_INET6 in Android libcore. * We also don't explicitly setsockopt IPV6_MULTICAST_HOPS, since this is to workaround a bug in old Linux kernels (< 2.4) and no longer relevant. Also while rewriting, several behaviour changes from M were found and the rewrite keeps the N behaviour: send: * If sendto(2) sets errno as ECONNREFUSED, we now throw PortUnreachableException instead of ignoring, and if it set errno as ECONNRESET, we throw IOException instead of ignoring. In all the other cases, we throw IOException instead of SocketException. recv/peek: * packet.address should only be updated if source address is different, and should be the same object if address is the same. Test: CtsLibcoreTestCases Bug: 28609551 Change-Id: I9a5c65cce8dee9695966012f8f2e3ddf9d84bae4
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions