Cohesive interfaces

Of course, once I’d teased apart the callback interface so that it was separate, clear and easy to use and document I realised that it was, in fact, 3 interfaces all jumbled together. They’re actually quite easy to spot, there are all of the callback functions that start with OnXXX (and a couple which don’t!), there are the filtering functions and there is CreateListeningSocket() call. All three sets are used by different kinds of user. The OnXXX interface is the real callback interface, the filtering interface has been present since the begining but is only currently used by the OpenSSL library to transparently layer SSL onto TCP connections (the reason that it’s only used there is that it’s such a pig of a messy, undocumented, interface to use). The listening socket function is only currently overridden by our bluetooth server as that needs to create a listening socket in a completely different way to TCP servers.

Obviously these now need to be split out so that the normal usage is easier…