Extend ServerSocket to be able to specify host to bind to
Logging Framework for C++
Brought to you by:
wilx
Hello, log4cplus developers.
We are using your lib for our internal purposes and have faced with the following issue:
We use ServerSocket
class to receive log events through network. But we need to restrict address our tool should bind to. Currently ServerSocket
uses:
server.sin_family = AF_INET; server.sin_addr.s_addr = INADDR_ANY; server.sin_port = htons(port);
only port can be specified.
We have implemented our extended version. Please consider to include it into one of the future releases.
Your comments about our code are highly appreciate.
Diff:
Rather than creating a new socket class, it would be nice to improve the existing one. It would help if you posted a complete and testable patch.
Last edit: Václav Haisman 2014-06-29
Hello,
please consider the new version in the attach. Unfortunately I do not have Windows host for developing thus I adjusted only socket-unix.cxx.
Hello,
Is there any progress on this matter?
I have applied a patch in the spirit of your patch onto master. I will take a look if I can easily transplant it also to 1.2.x. I am not sure if I will be adding it to 1.1.x at all.
I don't mind against adding this patch to 1.2 version.
Last edit: Maxim Kondratenko 2016-06-23