Add sphinx socket support for SphinxAPI connection

I also used ctype_digit() instead of is_numeric() because it is a faster and more accurate check.

Feel free to critique comment as needed.