| Index: runtime/bin/socket_base_android.cc
|
| diff --git a/runtime/bin/socket_base_android.cc b/runtime/bin/socket_base_android.cc
|
| index 0663a2936f47c12ba42c000f9ba22172c8e9cf3b..c54e84c39a3a81bb7a69af68c37df8a0195e8f79 100644
|
| --- a/runtime/bin/socket_base_android.cc
|
| +++ b/runtime/bin/socket_base_android.cc
|
| @@ -35,13 +35,11 @@ SocketAddress::SocketAddress(struct sockaddr* sa) {
|
| memmove(reinterpret_cast<void*>(&addr_), sa, salen);
|
| }
|
|
|
| -
|
| bool SocketBase::Initialize() {
|
| // Nothing to do on Android.
|
| return true;
|
| }
|
|
|
| -
|
| bool SocketBase::FormatNumericAddress(const RawAddr& addr,
|
| char* address,
|
| int len) {
|
| @@ -50,18 +48,15 @@ bool SocketBase::FormatNumericAddress(const RawAddr& addr,
|
| 0, NI_NUMERICHOST)) == 0);
|
| }
|
|
|
| -
|
| bool SocketBase::IsBindError(intptr_t error_number) {
|
| return error_number == EADDRINUSE || error_number == EADDRNOTAVAIL ||
|
| error_number == EINVAL;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::Available(intptr_t fd) {
|
| return FDUtils::AvailableBytes(fd);
|
| }
|
|
|
| -
|
| intptr_t SocketBase::Read(intptr_t fd,
|
| void* buffer,
|
| intptr_t num_bytes,
|
| @@ -77,7 +72,6 @@ intptr_t SocketBase::Read(intptr_t fd,
|
| return read_bytes;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::RecvFrom(intptr_t fd,
|
| void* buffer,
|
| intptr_t num_bytes,
|
| @@ -95,7 +89,6 @@ intptr_t SocketBase::RecvFrom(intptr_t fd,
|
| return read_bytes;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::Write(intptr_t fd,
|
| const void* buffer,
|
| intptr_t num_bytes,
|
| @@ -111,7 +104,6 @@ intptr_t SocketBase::Write(intptr_t fd,
|
| return written_bytes;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::SendTo(intptr_t fd,
|
| const void* buffer,
|
| intptr_t num_bytes,
|
| @@ -130,7 +122,6 @@ intptr_t SocketBase::SendTo(intptr_t fd,
|
| return written_bytes;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::GetPort(intptr_t fd) {
|
| ASSERT(fd >= 0);
|
| RawAddr raw;
|
| @@ -141,7 +132,6 @@ intptr_t SocketBase::GetPort(intptr_t fd) {
|
| return SocketAddress::GetAddrPort(raw);
|
| }
|
|
|
| -
|
| SocketAddress* SocketBase::GetRemotePeer(intptr_t fd, intptr_t* port) {
|
| ASSERT(fd >= 0);
|
| RawAddr raw;
|
| @@ -153,7 +143,6 @@ SocketAddress* SocketBase::GetRemotePeer(intptr_t fd, intptr_t* port) {
|
| return new SocketAddress(&raw.addr);
|
| }
|
|
|
| -
|
| void SocketBase::GetError(intptr_t fd, OSError* os_error) {
|
| int errorNumber;
|
| socklen_t len = sizeof(errorNumber);
|
| @@ -162,7 +151,6 @@ void SocketBase::GetError(intptr_t fd, OSError* os_error) {
|
| os_error->SetCodeAndMessage(OSError::kSystem, errorNumber);
|
| }
|
|
|
| -
|
| int SocketBase::GetType(intptr_t fd) {
|
| struct stat buf;
|
| int result = fstat(fd, &buf);
|
| @@ -181,12 +169,10 @@ int SocketBase::GetType(intptr_t fd) {
|
| return File::kOther;
|
| }
|
|
|
| -
|
| intptr_t SocketBase::GetStdioHandle(intptr_t num) {
|
| return num;
|
| }
|
|
|
| -
|
| AddressList<SocketAddress>* SocketBase::LookupAddress(const char* host,
|
| int type,
|
| OSError** os_error) {
|
| @@ -229,7 +215,6 @@ AddressList<SocketAddress>* SocketBase::LookupAddress(const char* host,
|
| return addresses;
|
| }
|
|
|
| -
|
| bool SocketBase::ReverseLookup(const RawAddr& addr,
|
| char* host,
|
| intptr_t host_len,
|
| @@ -247,7 +232,6 @@ bool SocketBase::ReverseLookup(const RawAddr& addr,
|
| return true;
|
| }
|
|
|
| -
|
| bool SocketBase::ParseAddress(int type, const char* address, RawAddr* addr) {
|
| int result;
|
| if (type == SocketAddress::TYPE_IPV4) {
|
| @@ -259,12 +243,10 @@ bool SocketBase::ParseAddress(int type, const char* address, RawAddr* addr) {
|
| return (result == 1);
|
| }
|
|
|
| -
|
| bool SocketBase::ListInterfacesSupported() {
|
| return false;
|
| }
|
|
|
| -
|
| AddressList<InterfaceSocketAddress>* SocketBase::ListInterfaces(
|
| int type,
|
| OSError** os_error) {
|
| @@ -278,13 +260,11 @@ AddressList<InterfaceSocketAddress>* SocketBase::ListInterfaces(
|
| return NULL;
|
| }
|
|
|
| -
|
| void SocketBase::Close(intptr_t fd) {
|
| ASSERT(fd >= 0);
|
| VOID_TEMP_FAILURE_RETRY(close(fd));
|
| }
|
|
|
| -
|
| bool SocketBase::GetNoDelay(intptr_t fd, bool* enabled) {
|
| int on;
|
| socklen_t len = sizeof(on);
|
| @@ -296,7 +276,6 @@ bool SocketBase::GetNoDelay(intptr_t fd, bool* enabled) {
|
| return (err == 0);
|
| }
|
|
|
| -
|
| bool SocketBase::SetNoDelay(intptr_t fd, bool enabled) {
|
| int on = enabled ? 1 : 0;
|
| return NO_RETRY_EXPECTED(setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
|
| @@ -304,7 +283,6 @@ bool SocketBase::SetNoDelay(intptr_t fd, bool enabled) {
|
| sizeof(on))) == 0;
|
| }
|
|
|
| -
|
| bool SocketBase::GetMulticastLoop(intptr_t fd,
|
| intptr_t protocol,
|
| bool* enabled) {
|
| @@ -321,7 +299,6 @@ bool SocketBase::GetMulticastLoop(intptr_t fd,
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::SetMulticastLoop(intptr_t fd,
|
| intptr_t protocol,
|
| bool enabled) {
|
| @@ -348,7 +325,6 @@ bool SocketBase::GetMulticastHops(intptr_t fd, intptr_t protocol, int* value) {
|
| return false;
|
| }
|
|
|
| -
|
| bool SocketBase::SetMulticastHops(intptr_t fd, intptr_t protocol, int value) {
|
| int v = value;
|
| int level = protocol == SocketAddress::TYPE_IPV4 ? IPPROTO_IP : IPPROTO_IPV6;
|
| @@ -358,7 +334,6 @@ bool SocketBase::SetMulticastHops(intptr_t fd, intptr_t protocol, int value) {
|
| fd, level, optname, reinterpret_cast<char*>(&v), sizeof(v))) == 0;
|
| }
|
|
|
| -
|
| bool SocketBase::GetBroadcast(intptr_t fd, bool* enabled) {
|
| int on;
|
| socklen_t len = sizeof(on);
|
| @@ -370,7 +345,6 @@ bool SocketBase::GetBroadcast(intptr_t fd, bool* enabled) {
|
| return (err == 0);
|
| }
|
|
|
| -
|
| bool SocketBase::SetBroadcast(intptr_t fd, bool enabled) {
|
| int on = enabled ? 1 : 0;
|
| return NO_RETRY_EXPECTED(setsockopt(fd, SOL_SOCKET, SO_BROADCAST,
|
| @@ -378,7 +352,6 @@ bool SocketBase::SetBroadcast(intptr_t fd, bool enabled) {
|
| sizeof(on))) == 0;
|
| }
|
|
|
| -
|
| bool SocketBase::JoinMulticast(intptr_t fd,
|
| const RawAddr& addr,
|
| const RawAddr&,
|
| @@ -391,7 +364,6 @@ bool SocketBase::JoinMulticast(intptr_t fd,
|
| setsockopt(fd, proto, MCAST_JOIN_GROUP, &mreq, sizeof(mreq))) == 0;
|
| }
|
|
|
| -
|
| bool SocketBase::LeaveMulticast(intptr_t fd,
|
| const RawAddr& addr,
|
| const RawAddr&,
|
|
|