session adaptation for sockets