-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bnet-server-tcp: split up creating+binding and listening
Instead of bnetservertcp doing open() + bind() + listen() all on its own, we instead split it up so that you can give the tcp server some already prepared sockets. This can be used for great effect in unit tests, where you can now 1) create the sockets inside the test with port set to 0 2) give those sockets to the tcp server to listen to 3) query the selected (free) port with getsockname This way you do not have to hardcode any ports inside the unit tests. This also another step in disentangling the socket code and the bareos core since you now do not need to read the address/port from the configuration. Hopefully we can in the future unit tests sockets without needing full blown config parsers.
- Loading branch information
Showing
6 changed files
with
180 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.