botan icon indicating copy to clipboard operation
botan copied to clipboard

Consolidate/fix BSD socket layer code

Open randombit opened this issue 4 years ago • 4 comments

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 avatar Dec 06 '19 16:12 randombit

@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 avatar Jan 24 '22 06:01 MiniMinstrel

@MiniMinstrel Yes please!

randombit avatar Jan 24 '22 13:01 randombit

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...

  1. 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?
  2. 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..?
  3. 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!

MiniMinstrel avatar Jan 29 '22 19:01 MiniMinstrel

@randombit I will begin work on this issue!

KerrickC avatar Sep 09 '22 16:09 KerrickC