added socket creation support on constructor