botan
botan copied to clipboard
Consolidate/fix BSD socket layer code
socket.cpp, socket_udp.cpp and cli/socket_utils.h have a lot of shared/duplicated code for handling differences in socket interface between BSD and Windsock. Consolidate into a single internal header which can be used across all three.
@randombit Good evening, this issue is still open to contributions, correct? I'd be willing to attempt to tackle this if it's still needs solving! :)
@MiniMinstrel Yes please!
Alright, I've been looking at the program for a while and brushing up on C++ knowledge...I have a few questions about the codebase...
- When you say shared/duplicated code, are you referring to the #includes as well? They do share those, should those be compiled into a single header file as well?
- My current line of thought for a solution is to create a boiler-plate class that both socket.cpp and socket_udp.cpp can derive from, as to cut down on the code necessary to create each. My only problem is figuring out a way for the header file to differentiate what file's calling it...if that's even possible, so that way I can change what's called when. Do you happen to have any ideas..?
- The consistencies with the two files and cli/socket_utils.h is primarily the error-catching systems, correct? I just wanted to check and make sure. Thank you very much again!
@randombit I will begin work on this issue!