Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: runtime/bin/socket_android.cc

Issue 163903002: Prototype of I/O statistics for Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fixes Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_ANDROID) 6 #if defined(TARGET_OS_ANDROID)
7 7
8 #include <errno.h> // NOLINT 8 #include <errno.h> // NOLINT
9 #include <stdio.h> // NOLINT 9 #include <stdio.h> // NOLINT
10 #include <stdlib.h> // NOLINT 10 #include <stdlib.h> // NOLINT
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 184
185 SocketAddress* Socket::GetRemotePeer(intptr_t fd, intptr_t* port) { 185 SocketAddress* Socket::GetRemotePeer(intptr_t fd, intptr_t* port) {
186 ASSERT(fd >= 0); 186 ASSERT(fd >= 0);
187 RawAddr raw; 187 RawAddr raw;
188 socklen_t size = sizeof(raw); 188 socklen_t size = sizeof(raw);
189 if (TEMP_FAILURE_RETRY_BLOCK_SIGNALS( 189 if (TEMP_FAILURE_RETRY_BLOCK_SIGNALS(
190 getpeername(fd, 190 getpeername(fd,
191 &raw.addr, 191 &raw.addr,
192 &size))) { 192 &size))) {
193 const int kBufferSize = 1024;
194 char error_message[kBufferSize];
195 strerror_r(errno, error_message, kBufferSize);
196 Log::PrintErr("Error getpeername: %s\n", error_message);
197 return NULL; 193 return NULL;
198 } 194 }
199 *port = SocketAddress::GetAddrPort(&raw); 195 *port = SocketAddress::GetAddrPort(&raw);
200 return new SocketAddress(&raw.addr); 196 return new SocketAddress(&raw.addr);
201 } 197 }
202 198
203 199
204 void Socket::GetError(intptr_t fd, OSError* os_error) { 200 void Socket::GetError(intptr_t fd, OSError* os_error) {
205 int errorNumber; 201 int errorNumber;
206 socklen_t len = sizeof(errorNumber); 202 socklen_t len = sizeof(errorNumber);
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 mreq.gr_interface = interfaceIndex; 577 mreq.gr_interface = interfaceIndex;
582 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); 578 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr));
583 return TEMP_FAILURE_RETRY_BLOCK_SIGNALS(setsockopt( 579 return TEMP_FAILURE_RETRY_BLOCK_SIGNALS(setsockopt(
584 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; 580 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
585 } 581 }
586 582
587 } // namespace bin 583 } // namespace bin
588 } // namespace dart 584 } // namespace dart
589 585
590 #endif // defined(TARGET_OS_ANDROID) 586 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/socket_linux.cc » ('j') | runtime/bin/socket_patch.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698