use InvalidArgumentException
moved socket classes into subdirectory, fixed phpdoc