Skip to content

Commit

Permalink
Fix clear connections
Browse files Browse the repository at this point in the history
  • Loading branch information
tvorogme committed Sep 13, 2024
1 parent 0244f54 commit 7d64279
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adnl/adnl-ext-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void AdnlExtServerImpl::add_local_id(AdnlNodeIdShort id) {

void AdnlExtServerImpl::alarm() {
alarm_timestamp() = td::Timestamp::in(1);
LOG(INFO) << "Clear TCP!";
LOG(INFO) << "Clear connections usage!";
ip_connection_count_.clear();
}

Expand All @@ -172,7 +172,7 @@ void AdnlExtServerImpl::accepted(td::SocketFd fd) {
connection_count++;
if (connection_count > 50){
LOG(INFO) << "Accept from: " << addr << " connections: " << connection_count << " TOO LARGE!";
fd.close();
// fd.close();
} else {
LOG(INFO) << "Accept from: " << addr << " connections: " << connection_count;
td::actor::create_actor<AdnlInboundConnection>(td::actor::ActorOptions().with_name("inconn").with_poll(),
Expand Down
1 change: 1 addition & 0 deletions adnl/adnl-ext-server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class AdnlExtServerImpl : public AdnlExtServer {
add_tcp_port(port);
}
ports_.clear();
alarm_timestamp() = td::Timestamp::in(1);
}

void alarm() override;
Expand Down

0 comments on commit 7d64279

Please sign in to comment.