Sock improvements

Improvements to use the stacks for the sockets