make thread safe sockets configurable