| 85 | } |
| 86 | |
| 87 | bool Connection::SendReceive(Command &cmd) |
| 88 | { |
| 89 | CommandSet sentSet = cmd.commandset; |
| 90 | byte sentCmd = cmd.command; |
| 91 | |
| 92 | // send the command, and receive the reply back into the same object. |
| 93 | // save the auto-generated ID for this command so we can compare it to the reply - we expect a |
| 94 | // synchronous reply, no other commands in the way. |
| 95 | uint32_t id = cmd.Send(writer); |
| 96 | cmd.commandset = CommandSet::Unknown; |
| 97 | cmd.command = 0; |
| 98 | cmd.Recv(reader); |
| 99 | Threading::Sleep(10); |
| 100 | |
| 101 | if(id != cmd.GetID()) |
| 102 | { |
| 103 | RDCERR("Didn't get matching reply packet for %d/%d (id %u), received %d/%d (id %u)", sentSet, |
| 104 | sentCmd, id, cmd.commandset, cmd.command, cmd.GetID()); |
| 105 | error = true; |
| 106 | return false; |
| 107 | } |
| 108 | |
| 109 | return true; |
| 110 | } |
| 111 | |
| 112 | void Connection::SetupIDSizes() |
| 113 | { |