rename client -> socket in sample code