We probably don't want these functions in public scope; move into TCP module?