Skip to content

MDNS Callback std:bind reference #6037

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 2 commits into from
May 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/ESP8266mDNS/src/LEAmDNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ bool MDNSResponder::setHostProbeResultCallback(MDNSResponder::MDNSHostProbeFn p_

bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn) {
using namespace std::placeholders;
return setHostProbeResultCallback(std::bind(pfn, *this, _1, _2));
return setHostProbeResultCallback(std::bind(pfn, std::ref(*this), _1, _2));
}

/*
Expand Down Expand Up @@ -1089,7 +1089,7 @@ bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSServ
bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
MDNSResponder::MDNSServiceProbeFn1 p_fnCallback) {
using namespace std::placeholders;
return setServiceProbeResultCallback(p_hService, std::bind(p_fnCallback, *this, _1, _2, _3));
return setServiceProbeResultCallback(p_hService, std::bind(p_fnCallback, std::ref(*this), _1, _2, _3));
}


Expand Down