diff options
| author | Maxime Coste <mawww@kakoune.org> | 2016-12-01 20:11:09 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2016-12-01 20:11:09 +0000 |
| commit | 8c862c4eea636b2d60c360e1fdebc94e2bdfd6d1 (patch) | |
| tree | ebdfe70be9ec8eaf16490b4d2c6ecc0c7ac9ee07 /src/remote.hh | |
| parent | 95c1528342c83a8ec599b2f49957d840d9695e8f (diff) | |
Only write to remote socket when we know they are writable
Buffer data (in an horribly innefficient way for now), and use the
event manager to watch for the socket being ready for a write.
Fixes #945
Diffstat (limited to 'src/remote.hh')
| -rw-r--r-- | src/remote.hh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/remote.hh b/src/remote.hh index 38340d48..6aaac49d 100644 --- a/src/remote.hh +++ b/src/remote.hh @@ -4,6 +4,7 @@ #include "env_vars.hh" #include "exception.hh" #include "utils.hh" +#include "vector.hh" #include <memory> @@ -12,14 +13,13 @@ namespace Kakoune struct remote_error : runtime_error { - remote_error(String error) - : runtime_error{std::move(error)} - {} + using runtime_error::runtime_error; }; class FDWatcher; class UserInterface; -struct Key; + +using RemoteBuffer = Vector<char, MemoryDomain::Remote>; // A remote client handle communication between a client running on the server // and a user interface running on the local process. @@ -32,6 +32,7 @@ public: private: std::unique_ptr<UserInterface> m_ui; std::unique_ptr<FDWatcher> m_socket_watcher; + RemoteBuffer m_send_buffer; }; void send_command(StringView session, StringView command); |
