8000 Added support for local binding. Closes #122 by jgaa · Pull Request #127 · jgaa/restc-cpp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added support for local binding. Closes #122 #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 20, 2022
Merged

Added support for local binding. Closes #122 #127

merged 3 commits into from
May 20, 2022

Conversation

jgaa
Copy link
Owner
@jgaa jgaa commented Apr 24, 2022

No description provided.

@jgaa jgaa self-assigned this Apr 24, 2022
Connection::ptr_t Connect(Context& ctx) {

static const auto timer_name = "Connect"s;

auto prot_filter = GetBindProtocols(properties_->bindToLocalAddress, ctx);

Choose a reason for hiding this comment

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

Only call GetBindProtocols() under if (!connection->GetSocket().IsOpen()) to save cost?

Copy link
Owner Author

Choose a reason for hiding this comment

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

It's the work-flow for new connections. All connection object instances are maintained by a connection-pool, and this block opens the connection if it is new.

Copy link
@gou4shi1 gou4shi1 Apr 28, 2022

Choose a reason for hiding this comment

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

I thought we could move this line to line 411 to save cost if the connection is already open, but there is a loop in line 396 so it also makes sense to keep it here, nvm.

@jgaa jgaa merged commit f243187 into master May 20, 2022
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
0