Executing commands with sockets