socket initial implementation