public static function close() { if (!is_null(self::$socket)) { foreach (self::$socket as $s) { socket_close($s); } self::$socket = null; } }