reworked protocols to better support socket handling.