* Cleaned up socket code to separate TCP and UDP socket handling. Connections are now far more robust.