tcping: modernize and add test