Loading api/system-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -3476,11 +3476,15 @@ package android.net.util { method public static void attachControlPacketFilter(java.io.FileDescriptor, int) throws java.net.SocketException; method public static void attachDhcpFilter(java.io.FileDescriptor) throws java.net.SocketException; method public static void attachRaFilter(java.io.FileDescriptor, int) throws java.net.SocketException; method public static void bindSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static void bindSocketToInterface(java.io.FileDescriptor, String) throws android.system.ErrnoException; method public static void closeSocket(java.io.FileDescriptor) throws java.io.IOException; method public static void connectSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static java.net.SocketAddress makeNetlinkSocketAddress(int, int); method public static java.net.SocketAddress makePacketSocketAddress(short, int); method public static java.net.SocketAddress makePacketSocketAddress(int, byte[]); method public static void sendTo(java.io.FileDescriptor, byte[], int, int, int, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static void setSocketTimeValueOption(java.io.FileDescriptor, int, int, long) throws android.system.ErrnoException; } } Loading api/test-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -912,11 +912,15 @@ package android.net.util { method public static void attachControlPacketFilter(java.io.FileDescriptor, int) throws java.net.SocketException; method public static void attachDhcpFilter(java.io.FileDescriptor) throws java.net.SocketException; method public static void attachRaFilter(java.io.FileDescriptor, int) throws java.net.SocketException; method public static void bindSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static void bindSocketToInterface(java.io.FileDescriptor, String) throws android.system.ErrnoException; method public static void closeSocket(java.io.FileDescriptor) throws java.io.IOException; method public static void connectSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static java.net.SocketAddress makeNetlinkSocketAddress(int, int); method public static java.net.SocketAddress makePacketSocketAddress(short, int); method public static java.net.SocketAddress makePacketSocketAddress(int, byte[]); method public static void sendTo(java.io.FileDescriptor, byte[], int, int, int, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static void setSocketTimeValueOption(java.io.FileDescriptor, int, int, long) throws android.system.ErrnoException; } } Loading core/java/android/net/util/SocketUtils.java +33 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.system.ErrnoException; import android.system.NetlinkSocketAddress; import android.system.Os; import android.system.PacketSocketAddress; import android.system.StructTimeval; import libcore.io.IoBridge; Loading Loading @@ -78,6 +79,38 @@ public class SocketUtils { return new PacketSocketAddress(ifIndex, hwAddr); } /** * Set an option on a socket that takes a time value argument. */ public static void setSocketTimeValueOption( FileDescriptor fd, int level, int option, long millis) throws ErrnoException { Os.setsockoptTimeval(fd, level, option, StructTimeval.fromMillis(millis)); } /** * Bind a socket to the specified address. */ public static void bindSocket(FileDescriptor fd, SocketAddress addr) throws ErrnoException, SocketException { Os.bind(fd, addr); } /** * Connect a socket to the specified address. */ public static void connectSocket(FileDescriptor fd, SocketAddress addr) throws ErrnoException, SocketException { Os.connect(fd, addr); } /** * Send a message on a socket, using the specified SocketAddress. */ public static void sendTo(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, SocketAddress addr) throws ErrnoException, SocketException { Os.sendto(fd, bytes, byteOffset, byteCount, flags, addr); } /** * @see IoBridge#closeAndSignalBlockedThreads(FileDescriptor) */ Loading Loading
api/system-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -3476,11 +3476,15 @@ package android.net.util { method public static void attachControlPacketFilter(java.io.FileDescriptor, int) throws java.net.SocketException; method public static void attachDhcpFilter(java.io.FileDescriptor) throws java.net.SocketException; method public static void attachRaFilter(java.io.FileDescriptor, int) throws java.net.SocketException; method public static void bindSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static void bindSocketToInterface(java.io.FileDescriptor, String) throws android.system.ErrnoException; method public static void closeSocket(java.io.FileDescriptor) throws java.io.IOException; method public static void connectSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static java.net.SocketAddress makeNetlinkSocketAddress(int, int); method public static java.net.SocketAddress makePacketSocketAddress(short, int); method public static java.net.SocketAddress makePacketSocketAddress(int, byte[]); method public static void sendTo(java.io.FileDescriptor, byte[], int, int, int, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static void setSocketTimeValueOption(java.io.FileDescriptor, int, int, long) throws android.system.ErrnoException; } } Loading
api/test-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -912,11 +912,15 @@ package android.net.util { method public static void attachControlPacketFilter(java.io.FileDescriptor, int) throws java.net.SocketException; method public static void attachDhcpFilter(java.io.FileDescriptor) throws java.net.SocketException; method public static void attachRaFilter(java.io.FileDescriptor, int) throws java.net.SocketException; method public static void bindSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static void bindSocketToInterface(java.io.FileDescriptor, String) throws android.system.ErrnoException; method public static void closeSocket(java.io.FileDescriptor) throws java.io.IOException; method public static void connectSocket(java.io.FileDescriptor, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static java.net.SocketAddress makeNetlinkSocketAddress(int, int); method public static java.net.SocketAddress makePacketSocketAddress(short, int); method public static java.net.SocketAddress makePacketSocketAddress(int, byte[]); method public static void sendTo(java.io.FileDescriptor, byte[], int, int, int, java.net.SocketAddress) throws android.system.ErrnoException, java.net.SocketException; method public static void setSocketTimeValueOption(java.io.FileDescriptor, int, int, long) throws android.system.ErrnoException; } } Loading
core/java/android/net/util/SocketUtils.java +33 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.system.ErrnoException; import android.system.NetlinkSocketAddress; import android.system.Os; import android.system.PacketSocketAddress; import android.system.StructTimeval; import libcore.io.IoBridge; Loading Loading @@ -78,6 +79,38 @@ public class SocketUtils { return new PacketSocketAddress(ifIndex, hwAddr); } /** * Set an option on a socket that takes a time value argument. */ public static void setSocketTimeValueOption( FileDescriptor fd, int level, int option, long millis) throws ErrnoException { Os.setsockoptTimeval(fd, level, option, StructTimeval.fromMillis(millis)); } /** * Bind a socket to the specified address. */ public static void bindSocket(FileDescriptor fd, SocketAddress addr) throws ErrnoException, SocketException { Os.bind(fd, addr); } /** * Connect a socket to the specified address. */ public static void connectSocket(FileDescriptor fd, SocketAddress addr) throws ErrnoException, SocketException { Os.connect(fd, addr); } /** * Send a message on a socket, using the specified SocketAddress. */ public static void sendTo(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, SocketAddress addr) throws ErrnoException, SocketException { Os.sendto(fd, bytes, byteOffset, byteCount, flags, addr); } /** * @see IoBridge#closeAndSignalBlockedThreads(FileDescriptor) */ Loading