Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/shared/Communication.h

Issue 10902015: Don't spawn a new engine if the pipe is busy (Closed)
Patch Set: Created June 6, 2013, 10:35 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/shared/Communication.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef COMMUNICATION_H 1 #ifndef COMMUNICATION_H
2 #define COMMUNICATION_H 2 #define COMMUNICATION_H
3 3
4 #include <memory> 4 #include <memory>
5 #include <sstream> 5 #include <sstream>
6 #include <stdexcept> 6 #include <stdexcept>
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include <Windows.h> 10 #include <Windows.h>
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 throw new std::runtime_error("Unexpected error writing to output buffer" ); 134 throw new std::runtime_error("Unexpected error writing to output buffer" );
135 } 135 }
136 }; 136 };
137 137
138 class PipeConnectionError : public std::runtime_error 138 class PipeConnectionError : public std::runtime_error
139 { 139 {
140 public: 140 public:
141 PipeConnectionError(); 141 PipeConnectionError();
142 }; 142 };
143 143
144 class PipeBusyError : public std::runtime_error
145 {
146 public:
147 PipeBusyError();
148 };
149
144 class Pipe 150 class Pipe
145 { 151 {
146 public: 152 public:
147 enum Mode {MODE_CREATE, MODE_CONNECT}; 153 enum Mode {MODE_CREATE, MODE_CONNECT};
148 154
149 Pipe(const std::wstring& name, Mode mode); 155 Pipe(const std::wstring& name, Mode mode);
150 ~Pipe(); 156 ~Pipe();
151 157
152 InputBuffer ReadMessage(); 158 InputBuffer ReadMessage();
153 void WriteMessage(OutputBuffer& message); 159 void WriteMessage(OutputBuffer& message);
154 160
155 protected: 161 protected:
156 HANDLE pipe; 162 HANDLE pipe;
157 }; 163 };
158 } 164 }
159 165
160 #endif 166 #endif
OLDNEW
« no previous file with comments | « no previous file | src/shared/Communication.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld