Closed bohdantrotsenko closed 5 years ago
If we're going to change it it probably makes sense to move towards the net.Conn[https://golang.org/pkg/net/#Conn] interface. Then hold 2 connections (Broadcast & Unicast).
Do you have any thoughts/opinions on that?
There is an issue with this abstraction.
At renew stage I want the dhcp client to use unicast.
The current abstraction, Write([]byte)
doesn't include the broadcast/unicast option, therefore I have updated the signature (by the way, I could use a different name for that, e.g. WriteUnicast([]byte, net.IP, net.IP)
Therefore, the net.Conn
, which here should serve both for a) broadcasting b) unicasting, as I see it, doesn't fit.
This should now be implemented in the v2 branch. Let me know if you see any issues.
This change is dictated by the need to send renew requests via unicast. That breaks the beauty of interfaces and inetsock.