start of socket layer conversion