summaryrefslogtreecommitdiff
path: root/src/xsurveyor.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-04-17 07:56:41 +0200
committerMartin Sustrik <sustrik@250bpm.com>2012-04-18 07:14:34 +0200
commitca8955058c2570df094cc97ed4e0757dc6647fd8 (patch)
tree0d281110541373b0bf65586aa067e489cad28d0e /src/xsurveyor.cpp
parent94a8234624892d6fab8bd5255263c8bee7068ad6 (diff)
Discard pending surveys when (X)SURVEYOR socket disappears
This is an optimisation. The idea is that when surveyor disappears it makes no sense to process any surveys it have sent. There are two cases handled: - when (X)SURVEYOR socket is closed any unsent outbound messages are discarded - when (X)RESPONDENT detects that its peer have disconnected it drops any unprocessed messages that have been received from it Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/xsurveyor.cpp')
-rw-r--r--src/xsurveyor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xsurveyor.cpp b/src/xsurveyor.cpp
index 4265437..985b6d8 100644
--- a/src/xsurveyor.cpp
+++ b/src/xsurveyor.cpp
@@ -26,6 +26,10 @@ xs::xsurveyor_t::xsurveyor_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
socket_base_t (parent_, tid_, sid_)
{
options.type = XS_XSURVEYOR;
+
+ // When the XSURVEYOR socket is close it makes no sense to send any pending
+ // surveys. The responses will be unroutable anyway.
+ options.delay_on_close = false;
}
xs::xsurveyor_t::~xsurveyor_t ()