endpoint and socket creation