add handling of command type connection

add a function to send a command, and wait for all responses to come back