Skip to content

Commit

Permalink
Bid Response::send [TCP] done
Browse files Browse the repository at this point in the history
  • Loading branch information
pereira0x committed Dec 8, 2023
1 parent 3864149 commit c876e48
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/utils/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,9 +836,26 @@ void BidRequest::receive(int fd) {
}

void BidResponse::send(int fd) {
if (fd == -1)
return;
return;
std::stringstream stream;
stream << BidResponse::ID << " ";

if (status == ACC) {
stream << "ACC";
} else if (status == NOK) {
stream << "NOK";
} else if (status == NLG) {
stream << "NLG";
} else if (status == REF) {
stream << "REF";
} else if (status == ILG) {
stream << "ILG";
} else if (status == ERR) {
stream << "ERR";
} else {
throw InvalidPacketException();
}
stream << std::endl;
writeString(fd, stream.str());
}

void BidResponse::receive(int fd) {
Expand Down

0 comments on commit c876e48

Please sign in to comment.