Commit Graph

24 Commits

Author SHA1 Message Date
Peter Johnson
a86f65db1e Dispatcher: Implement transmit combining.
This handles most of the major cases, but not a loop of delete/assign, which
should be uncommon anyway.
2015-08-02 23:21:23 -07:00
Peter Johnson
e9073a3cc0 Implement notifiers.
The notifier thread is lazily started when the first notifier is added.
This avoids the extra thread/processing overhead when notifiers are not used.
2015-08-02 21:47:01 -07:00
Peter Johnson
538a19fd47 Implement GetConnections(). 2015-08-02 10:47:05 -07:00
Peter Johnson
84ff80710c Refactor TCP-specific pieces of Dispatcher. 2015-08-02 00:33:41 -07:00
Peter Johnson
6703968f73 Dispatcher: Fix shutdown order race.
We need to wait until after the dispatch and client/server threads have
been stopped before closing connections, as these threads can add connections.
2015-08-01 23:37:13 -07:00
Peter Johnson
b5274a495e Dispatcher: Don't call Storage::GetInstance() internally.
This makes it difficult to test.  Instead, store reference as member variable,
and populate it at constuction (with an alternate constructor available for
test purposes).
2015-08-01 11:15:04 -07:00
Peter Johnson
11508b77d1 Ensure initial synchronization is atomic. 2015-07-31 23:56:06 -07:00
Peter Johnson
c2eb4a766e Dispatcher: Provide some INFO-level connection messages. 2015-07-31 23:26:38 -07:00
Peter Johnson
3a71acec52 Automatically reconnect client.
Also clean up some condition variable handling to make it more robust.
2015-07-31 23:14:26 -07:00
Peter Johnson
a9af4589ac Don't send empty message lists from dispatch.
This terminates the write thread.
2015-07-31 22:49:43 -07:00
Peter Johnson
4356e313ec Add logging framework.
DEBUG messages are completely optimized out if NDEBUG is defined.
2015-07-31 22:41:26 -07:00
Peter Johnson
ead125555c Implement client/server handshaking. 2015-07-31 20:32:52 -07:00
Peter Johnson
138ebf5b4d Storage: generate messages rather than intermediate updates. 2015-07-31 13:21:19 -07:00
Peter Johnson
83be99e78c Immediately process incoming messages.
This required moving message processing into the Storage class.
2015-07-29 23:45:04 -07:00
Peter Johnson
5b5e3ae6aa Dispatcher: Start implementing processing of incoming messages. 2015-07-29 20:33:26 -07:00
Peter Johnson
b4c65dc210 Make global instance init thread-safe.
Use local statics except for Visual C++ < 2015.
2015-07-20 23:36:22 -07:00
Peter Johnson
6b2fb02bed Dispatcher: Don't in-place construct atomics.
Visual C++ 2013 doesn't support this.
2015-07-20 20:21:37 -07:00
Peter Johnson
8938a19810 Dispatcher: Avoid warning by using for(;;) instead of while(true). 2015-07-20 20:20:01 -07:00
Peter Johnson
158ae61811 Dispatcher::SetUpdateRate(): Explicitly convert to int. 2015-07-20 20:19:01 -07:00
Peter Johnson
c9260ea785 Change GetEntryTypeFunc to std::function.
Also implement it as a member function of Dispatcher.
2015-07-19 23:17:14 -07:00
Peter Johnson
9b7e265762 Continue implementing client. 2015-07-18 01:29:24 -07:00
Peter Johnson
412e8034de Start implementing client and server. 2015-07-17 22:39:36 -07:00
Peter Johnson
fcbd2751ba Provide C++ API. Move all classes to "nt" namespace.
The C API is now just simple wrappers around the C++ API.
2015-07-17 07:21:07 -07:00
Peter Johnson
56f1481c24 Add Dispatcher. 2015-07-16 22:55:50 -07:00