summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2019-01-25 20:43:12 +0000
committerGitHub <noreply@github.com>2019-01-25 20:43:12 +0000
commit6a9ec900f656439652b2f20e34b2452d561eb0a6 (patch)
treeb65a46273b8040ab6597b0b9173ae3717f7ba737
parentee7c940a4ba8ec5f0971d2b0cf89ebcfc6057b18 (diff)
[async] re-add modifiers to Send method (#239)
-rw-r--r--dhcpv4/async/client.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/dhcpv4/async/client.go b/dhcpv4/async/client.go
index 81b10f7..617c711 100644
--- a/dhcpv4/async/client.go
+++ b/dhcpv4/async/client.go
@@ -194,7 +194,11 @@ func (c *Client) remoteAddr() (*net.UDPAddr, error) {
// Send inserts a message to the queue to be sent asynchronously.
// Returns a future which resolves to response and error.
-func (c *Client) Send(message *dhcpv4.DHCPv4) *promise.Future {
+func (c *Client) Send(message *dhcpv4.DHCPv4, modifiers ...dhcpv4.Modifier) *promise.Future {
+ for _, mod := range modifiers {
+ mod(message)
+ }
+
p := promise.NewPromise()
c.packetsLock.Lock()
c.packets[message.TransactionID] = p