We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d035564 + 16dcaf0 commit 3af14c6Copy full SHA for 3af14c6
client.go
@@ -33,7 +33,15 @@ func NewClient(ifi *net.Interface) (*Client, error) {
33
if err != nil {
34
return nil, err
35
}
36
+ return NewClientPacketConn(ifi, p)
37
+}
38
39
+// NewClientPacketConn creates a new Client using the specified network interface
40
+// and net.PacketConn. This allows the caller to define exactly how they bind to the
41
+// net.PacketConn. This is most useful to define what protocol to pass to socket(7).
42
+//
43
+// In most cases, callers would be better off calling NewClient.
44
+func NewClientPacketConn(ifi *net.Interface, p net.PacketConn) (*Client, error) {
45
// Check for usable IPv4 addresses for the Client
46
addrs, err := ifi.Addrs()
47
0 commit comments