9 Commits

Author SHA1 Message Date
Ben Clayton
6d6cbf17d7 Add support for rapidjson as the JSON library
nlohmann is still the default, but if `CPPDAP_JSON_DIR` points to rapidjson, then this will be used instead

Most of this was upstreamed from:
https://fuchsia-review.googlesource.com/c/third_party/github.com/google/cppdap/+/456566
2020-12-02 17:44:24 +00:00
Ben Clayton
2f607e077a Fix deadlock closing socket on another thread
while another thread is stuck in read() or write().

Fixes: #37
2020-06-10 10:28:39 +01:00
Ben Clayton
9003ee55b9 Socket: Use the RWMutex to fix TSAN error
... about `close()`ing the socket on one thread while in a blocking `recv()` or `send()` call on another thread.

Fixes #35
2020-06-08 21:32:05 +01:00
Ben Clayton
13c9e7d465 Implement timeouts for dap::Socket::connect
Fixes: #24
2020-06-08 20:22:05 +01:00
Ben Clayton
ad9b4588f2 Fix dap::Socket::read() when recv() errors
Identified by @kuafuwang.

Fixes #29
2020-05-27 18:40:08 +01:00
Ben Clayton
4dcca57756 Socket: Enable TCP_NODELAY
DAP usually consists of small packet requests, with small packet responses. When there are many frequent, blocking requests made, Nagle's algorithm can dramatically limit the request->response rates.
2020-03-13 07:01:42 +00:00
Ben Clayton
de7dffaf66 Socket: Use SO_REUSEADDR, disable SO_LINGER
Use these to avoid "socket in use" errors when restarting a DAP that uses the same port.
2020-01-28 14:44:35 +00:00
Ben Clayton
1f7f48904a Fix memory leak in src/socket.cpp 2019-11-14 00:37:38 +00:00
Ben Clayton
2dfd15462f Initial drop of cppdap 2019-11-08 21:58:50 +00:00