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

Side by Side Diff: experimental/visual_studio_plugin/src/rsp_proxy/proxy_socket.h

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Native Client Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef EXPERIMENTAL_VISUAL_STUDIO_PLUGIN_SRC_RSP_PROXY_PROXY_SOCKET_H_
6 #define EXPERIMENTAL_VISUAL_STUDIO_PLUGIN_SRC_RSP_PROXY_PROXY_SOCKET_H_
7
8 #include <winsock.h>
9 #include <string>
10
11 namespace debug {
12
13 // Implements a listening socket.
14 // Example:
15 // ListeningSocket lsn;
16 // lsn.Setup(4014);
17 // Socket conn;
18 // if (lsn.Accept(&conn, 200))
19 // DoSomethingWithNewConnection(conn);
20
21 class Socket;
22 class ListeningSocket {
23 public:
24 ListeningSocket();
25 ~ListeningSocket();
26
27 bool Setup(int port); // Listens on port.
28 bool Accept(Socket* new_connection, int wait_ms);
29 void Close();
30
31 private:
32 SOCKET sock_;
33 bool init_success_;
34 };
35
36 // Implements a raw socket interface.
37 // Example:
38 // Socket conn;
39 // if (conn.ConnectTo("172.29.20.175", 4016))
40 // DoSomethingWithNewConnection(conn);
41
42 class Socket {
43 public:
44 Socket();
45 ~Socket();
46
47 bool ConnectTo(const std::string& host, int port);
48 bool IsConnected() const;
49 void Close();
50 size_t Read(void* buff, size_t sz, int wait_ms);
51 size_t Write(const void* buff, size_t sz, int wait_ms);
52 void WriteAll(const void* buff, size_t sz);
53
54 private:
55 void AttachTo(SOCKET sock);
56
57 SOCKET sock_;
58 bool init_success_;
59 friend class ListeningSocket;
60 };
61 } // namespace debug
62 #endif // EXPERIMENTAL_VISUAL_STUDIO_PLUGIN_SRC_RSP_PROXY_PROXY_SOCKET_H_
63
64
OLDNEW
« no previous file with comments | « experimental/visual_studio_plugin/src/loop/readme.txt ('k') | experimental/visual_studio_plugin/src/rsp_proxy/proxy_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698