uNetworking / uSockets

Miniscule cross-platform eventing, networking & crypto for async applications
Apache License 2.0
1.29k stars 268 forks source link

Merge SSL and non-SSL interfaces #26

Closed ghost closed 5 years ago

ghost commented 5 years ago

Instead of having two sets of functions; us_ssl_socket_ext and us_socket_ext, etc, you could have one single:

us_socket * can be SSL or non-SSL, it is determined by us_socket_ext(SSL or not, ...)

Instead of two different sets of functions almost identical, what is not identical could be hints instead. So SSL options could be hints that can be ignored for non-SSL.

That would clear up a lot of template magic in µWS and make it a lot easier to work with.

First step: add a new layer named us_any_socket and us_any_socket_ext, etc -> have it be a set of macros to correct function.

Second step: rename everything so that _any prefix can be removed.

ghost commented 5 years ago

Done, libusockets_new.h has the new interface