Made LOTS of changes to the socket framework.