Fixed socket calls--added struct ptr