A simple class for managing  TCP and UDP Socket