i have seen many WOL instances use port 7 and many use port 9, does it matter? Isn't it just looking for a WOL packet at layer 2 or ethernet?
@Spiff is correct that it doesn't matter as far as the Wake-on-LAN functionality of the intended recipient goes. However, UDP is recommended because it can be generated without raw sockets which come with security restrictions, and port 9 is recommended because it maps to the old well-known discard protocol whereas port 7 maps to the echo protocol.
This means that if there are hosts on your network that support these old simple standard services you will get unnecessary backscatter traffic when using port 7 but none when using port 9. And since Wake-on-LAN is normally broadcasted, you could get backscatter from many hosts.
Further, if you are troubleshooting WoL with a network sniffer such as Wireshark, it will decode WoL packets properly only if they are UDP packets on port 9.
When I woke my computer using port 9 it would restart instead of coming out of sleep. For the life of me I couldn't figure out what I did wrong. I tried using port 7 and instead of restarting it woke up normally. It doesn't seem to matter most of the time which you use, but for my hardware I need to use port 7.