use int sock to check returns from socket