diff options
author | Attila Molnar <attilamolnar@hush.com> | 2017-07-11 15:34:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-11 15:34:43 +0200 |
commit | 251cbbed350a4b3396cc069f8a035d0fa17562b3 (patch) | |
tree | 645d98c5eb05ebe8ed4f1aebd9d060d296e41b3b /include | |
parent | e97ee390cf1a3f5e897aed85d62e29a34c4632f9 (diff) | |
parent | 8e8b0719bf58e2d875c06698f86377189da87e16 (diff) |
Merge pull request #1310 from rburchell/master
Improve and centralize socket engine event counters.
Diffstat (limited to 'include')
-rw-r--r-- | include/socketengine.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/socketengine.h b/include/socketengine.h index c0026bfc6..b00643952 100644 --- a/include/socketengine.h +++ b/include/socketengine.h @@ -244,11 +244,19 @@ class CoreExport SocketEngine */ Statistics() : lastempty(0), TotalEvents(0), ReadEvents(0), WriteEvents(0), ErrorEvents(0) { } - /** Increase the counters for bytes sent/received in this second. - * @param len_in Bytes received, 0 if updating number of bytes written. - * @param len_out Bytes sent, 0 if updating number of bytes read. + /** Update counters for network data received. + * This should be called after every read-type syscall. + * @param len_in Number of bytes received, or -1 for error, as typically + * returned by a read-style syscall. */ - void Update(size_t len_in, size_t len_out); + void UpdateReadCounters(int len_in); + + /** Update counters for network data sent. + * This should be called after every write-type syscall. + * @param len_out Number of bytes sent, or -1 for error, as typically + * returned by a read-style syscall. + */ + void UpdateWriteCounters(int len_out); /** Get data transfer statistics. * @param kbitspersec_in Filled with incoming traffic in this second in kbit/s. |