Skip to content

Reorganize tcp_listener#4515

Merged
pwojcikdev merged 4 commits intonanocurrency:developfrom
pwojcikdev:networking-fixes/tcp-listener-reorg
Mar 22, 2024
Merged

Reorganize tcp_listener#4515
pwojcikdev merged 4 commits intonanocurrency:developfrom
pwojcikdev:networking-fixes/tcp-listener-reorg

Conversation

@pwojcikdev
Copy link
Copy Markdown
Contributor

This is a preparation for future tcp_listener changes. It doesn't change functionality of the class significantly, but moves it to a dedicated file and reduces header coupling.

std::size_t nano::transport::tcp_listener::connection_count ()
{
nano::lock_guard<nano::mutex> lock{ mutex };
cleanup ();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an odd place to do cleanup.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's less than ideal, but this is an intermediate step before doing larger refactoring.

Copy link
Copy Markdown
Contributor

@clemahieu clemahieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good if the cleanup is going to be called in a more reliable place in future patches.

@pwojcikdev pwojcikdev merged commit 8281cdb into nanocurrency:develop Mar 22, 2024
@pwojcikdev pwojcikdev deleted the networking-fixes/tcp-listener-reorg branch March 22, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants