encapsulate function getlistenfd()