Development code for Sockets provider

- This is an incremental devel code for Sockets provider.

no declarations in middle of functions - they are too hard to find later