match socket API with direct API