TCP acceptor and validation fixed, logs and dot consistency

This commit is contained in:
Matej Sekoranja
2014-09-04 20:44:12 +02:00
parent 6bd1efa313
commit b14333f720
7 changed files with 33 additions and 13 deletions

View File

@@ -205,12 +205,17 @@ namespace pvAccess {
// validate connection
if(!validateConnection(transport, ipAddrStr)) {
// TODO
// wait for negative response to be sent back and
// hold off the client for retrying at very high rate
epicsThreadSleep(1.0);
transport->close();
LOG(
logLevelDebug,
"Connection to PVA client %s failed to be validated, closing it.",
ipAddrStr);
return;
continue;
}
LOG(logLevelDebug, "Serving to PVA client: %s.", ipAddrStr);
@@ -223,9 +228,7 @@ namespace pvAccess {
bool BlockingTCPAcceptor::validateConnection(Transport::shared_pointer const & transport, const char* address) {
try {
// TODO constant
transport->verify(5000);
return true;
return transport->verify(5000);
} catch(...) {
LOG(logLevelDebug, "Validation of %s failed.", address);
return false;