Skip to content

Commit

Permalink
Sil implementation (#33)
Browse files Browse the repository at this point in the history
* Prototype

* Simplify

* Reorder variables

* Update

* Remove accdient files

* Add more prints to udpclient sim
  • Loading branch information
gabekole authored Sep 30, 2024
1 parent 8557b4a commit f68626e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hardware_simulation/UDPClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,12 @@ class UDPClient {
local_addr.sin_family = AF_INET;
local_addr.sin_addr.s_addr = INADDR_ANY;
local_addr.sin_port = htons(SIM_LOCAL_PORT);

std::cout << "Attempting local bind on port " << std::to_string(SIM_LOCAL_PORT) << std::endl;

if (bind(socket_fd, (struct sockaddr*)&local_addr, sizeof(local_addr)) == -1) {
std::cerr << "Bind failed" << std::endl;
std::cerr << "Bind failed on port " << std::to_string(SIM_LOCAL_PORT) << std::endl;

return false;
}

Expand Down Expand Up @@ -219,4 +222,4 @@ class UDPClient {

UDPClient(const UDPClient&) = delete;
UDPClient& operator=(const UDPClient&) = delete;
};
};

0 comments on commit f68626e

Please sign in to comment.