Working on putting together a C++ app that will control my lights via LAN API. However, upon broadcasting the packet out, I do not receive any responses from the lights (but I do receive my broadcasted packet).
Okay so you have two sockets, client_socket and server_socket. server_socket is listening on INADDR_ANY and port 56700 so it will receive all packets sent on the network to port 56700. client_socket is also listening on INADDR_ANY but it is listening on a free port chosen by the operating system.
When you send the packet you are setting the source field so the bulb will respond by setting the destination port and destination address to the source port and source address.
You send the packet out of the client_socket which means the packet will have a source address set to your IP, and the random port chosen by the OS. As such the bulb will respond to you, on that random port. This means that the packet will return to the client_socket and not the server_socket. You should try to receive your packets on the client_socket instead. You should be able to completely remove the server_socket.
Okay I went through your example to try and get if going on my machine, and I found a few more issues …
You are using the wrong header, not sure where you got yours but the correct one can be found at the bottom of the header description page in the official documentation.
If you would like the bulb to respond you need to set either res_required or ack_required depending in the type of responses you would like.
I’m not great at C++ and don’t have Windows, so I altered your code to work in C on Linux and got it working. I’ve uploaded it to a gist for you.