Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
65238e01
Commit
65238e01
authored
Nov 29, 2013
by
Marcin Siodelski
Browse files
[2765] Pass error handler when opening sockets in the constructor.
parent
00d6ca04
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp4/dhcp4_srv.cc
View file @
65238e01
...
...
@@ -108,10 +108,15 @@ Dhcpv4Srv::Dhcpv4Srv(uint16_t port, const char* dbconfig, const bool use_bcast,
// will be able to respond directly.
IfaceMgr
::
instance
().
setMatchingPacketFilter
(
direct_response_desired
);
// Open sockets only if port is non-zero. Port 0 is used
// for non-socket related testing.
if
(
port
)
{
// open sockets only if port is non-zero. Port 0 is used
// for non-socket related testing.
IfaceMgr
::
instance
().
openSockets4
(
port_
,
use_bcast_
);
// Create error handler. This handler will be called every time
// the socket opening operation fails. We use this handler to
// log a warning.
isc
::
dhcp
::
IfaceMgrErrorMsgCallback
error_handler
=
boost
::
bind
(
&
Dhcpv4Srv
::
ifaceMgrSocket4ErrorHandler
,
_1
);
IfaceMgr
::
instance
().
openSockets4
(
port_
,
use_bcast_
,
error_handler
);
}
string
srvid_file
=
CfgMgr
::
instance
().
getDataDir
()
+
"/"
+
string
(
SERVER_ID_FILE
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment