first draft pluggable - FIX SOCKET CODE