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

Unified Diff: runtime/bin/socket.h

Issue 9699017: Start better error reporting for sockets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added tests Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/socket.h
diff --git a/runtime/bin/socket.h b/runtime/bin/socket.h
index 4a42d05034ecda5dc44702332c6e0cb7a6a2c85d..5650baf01e092c5e79481d22f9d68432d400374e 100644
--- a/runtime/bin/socket.h
+++ b/runtime/bin/socket.h
@@ -6,11 +6,17 @@
#define BIN_SOCKET_H_
#include "bin/builtin.h"
+#include "bin/utils.h"
#include "platform/globals.h"
+#include "platform/thread.h"
class Socket {
public:
+ enum SocketRequest {
+ kLookupRequest = 0,
+ };
+
static bool Initialize();
static intptr_t Available(intptr_t fd);
static int Read(intptr_t fd, void* buffer, intptr_t num_bytes);
@@ -19,6 +25,18 @@ class Socket {
static intptr_t GetPort(intptr_t fd);
static intptr_t GetStdioHandle(int num);
+ // Perform a IPv4 hostname lookup. Returns the hostname string in
+ // IPv4 dotted-decimal format.
+ static const char* LookupIPv4Address(char* host, OSError** os_error);
+
+ static Dart_Port GetServicePort();
+
+ private:
+ static dart::Mutex mutex_;
+ static int service_ports_size_;
+ static Dart_Port* service_ports_;
+ static int service_ports_index_;
+
DISALLOW_ALLOCATION();
DISALLOW_IMPLICIT_CONSTRUCTORS(Socket);
};

Powered by Google App Engine
This is Rietveld 408576698