rewrite local address detectionmake some functions static that arr not needed globallyrework how fd_set is construction for the main loop select()