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

Unified Diff: runtime/bin/sync_socket.h

Issue 2830273002: [dart:io][windows] Implements RawSynchronousSocket (Closed)
Patch Set: Fix Linux build Created 3 years, 8 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
« no previous file with comments | « runtime/bin/socket_base_win.cc ('k') | runtime/bin/sync_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/sync_socket.h
diff --git a/runtime/bin/sync_socket.h b/runtime/bin/sync_socket.h
index b6eb784bc0b5db1a89296ae34871bd3943b02535..8a58853a6b6d050018573d24db6efa20aa0a73c8 100644
--- a/runtime/bin/sync_socket.h
+++ b/runtime/bin/sync_socket.h
@@ -17,11 +17,11 @@ namespace bin {
class SynchronousSocket {
public:
- explicit SynchronousSocket(intptr_t fd);
+ explicit SynchronousSocket(intptr_t fd) : fd_(fd) {}
~SynchronousSocket() { ASSERT(fd_ == kClosedFd); }
intptr_t fd() const { return fd_; }
- void SetClosedFd();
+ void SetClosedFd() { fd_ = kClosedFd; }
static bool Initialize();
@@ -32,8 +32,15 @@ class SynchronousSocket {
static Dart_Handle GetSocketIdNativeField(Dart_Handle socket_obj,
SynchronousSocket** socket);
+ static intptr_t Available(intptr_t fd);
+ static intptr_t GetPort(intptr_t fd);
+ static SocketAddress* GetRemotePeer(intptr_t fd, intptr_t* port);
+ static intptr_t Read(intptr_t fd, void* buffer, intptr_t num_bytes);
+ static intptr_t Write(intptr_t fd, const void* buffer, intptr_t num_bytes);
+
static void ShutdownRead(intptr_t fd);
static void ShutdownWrite(intptr_t fd);
+ static void Close(intptr_t fd);
private:
static const int kClosedFd = -1;
« no previous file with comments | « runtime/bin/socket_base_win.cc ('k') | runtime/bin/sync_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698