Adding error checked socket code example