Socket test updated for handleDevice