abstract socket support

fix #1486