OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-cog commits / 2c9ecff

The _open_socks list no longer needed.
2c9ecff303412a80620814ed95a416decba0d13e
by Linas Vepstas <linasvepstas@gmail.com> · 2025-12-07T15:23:15.000Z

Changed files (2) +0 -12

opencog/persist/cog-storage/CogChannel.cc +0 -8
……@@ -138,8 +138,6 @@ void CogChannel<Client, Data>::open_connection(const std::string& uri)
138138 _servinfo = nullptr;
139139 if (0 != s._sockfd)
140140 {
141 std::lock_guard<std::mutex> lck(_sock_set_mtx);
142 _open_socks.erase(s._sockfd);
143141 close(s._sockfd);
144142 s._sockfd = 0;
145143 }
……@@ -148,8 +146,6 @@ void CogChannel<Client, Data>::open_connection(const std::string& uri)
148146
149147 if (0 != s._sockfd)
150148 {
151 std::lock_guard<std::mutex> lck(_sock_set_mtx);
152 _open_socks.erase(s._sockfd);
153149 close(s._sockfd);
154150 s._sockfd = 0;
155151 }
……@@ -213,9 +209,6 @@ int CogChannel<Client, Data>::open_sock()
213209
214210 _nsocks++;
215211
216 std::lock_guard<std::mutex> lck(_sock_set_mtx);
217 _open_socks.insert(sockfd);
218
219212 return sockfd;
220213}
221214
……@@ -230,7 +223,6 @@ void CogChannel<Client, Data>::close_connection(void)
230223{
231224 _msg_buffer.barrier();
232225 _msg_buffer.close();
233 _open_socks.clear();
234226
235227 freeaddrinfo((struct addrinfo *) _servinfo);
236228 _servinfo = nullptr;
opencog/persist/cog-storage/CogChannel.h +0 -4
……@@ -54,10 +54,6 @@ class CogChannel
5454 void* _servinfo;
5555 std::atomic_int _nsocks{0};
5656
57 // Registry of open sockets, for barrier synchronization.
58 std::set<int> _open_socks;
59 std::mutex _sock_set_mtx;
60
6157 // Socket API.
6258 static thread_local struct tlso {
6359 int _sockfd;