mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Improved peer client connection websocat error handling.
This commit is contained in:
@@ -45,9 +45,10 @@ namespace comm
|
||||
close(write_pipe[0]);
|
||||
close(read_pipe[1]);
|
||||
|
||||
// Wait for some time and check if websocat is still running properly.
|
||||
util::sleep(20);
|
||||
if (kill(pid, 0) == -1)
|
||||
// Wait for some time and check if websocat process has closed the pipe.
|
||||
util::sleep(300);
|
||||
pollfd fds[1] = {{read_fd}};
|
||||
if (poll(fds, 1, 0) == -1 || (fds[0].revents & POLLHUP))
|
||||
{
|
||||
close(read_fd);
|
||||
close(write_fd);
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace comm
|
||||
comm::comm_client client;
|
||||
if (client.start(host, port, metric_thresholds, conf::cfg.peermaxsize) == -1)
|
||||
{
|
||||
LOG_ERR << "Outbound connection attempt failed";
|
||||
LOG_ERR << "Outbound connection attempt failed: " << host << ":" << std::to_string(port);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -204,6 +204,7 @@ namespace util
|
||||
sigset_t mask;
|
||||
sigemptyset(&mask);
|
||||
sigaddset(&mask, SIGINT);
|
||||
sigaddset(&mask, SIGPIPE);
|
||||
pthread_sigmask(SIG_BLOCK, &mask, NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user