Added support for getting socket diagnosis information.

Review: https://reviews.apache.org/r/25948