summaryrefslogtreecommitdiffhomepage
path: root/examples/server6/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'examples/server6/main.go')
-rw-r--r--examples/server6/main.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/server6/main.go b/examples/server6/main.go
index 174f798..318937f 100644
--- a/examples/server6/main.go
+++ b/examples/server6/main.go
@@ -14,14 +14,14 @@ func handler(conn net.PacketConn, peer net.Addr, m dhcpv6.DHCPv6) {
}
func main() {
- laddr := net.UDPAddr{
+ laddr := &net.UDPAddr{
IP: net.ParseIP("::1"),
Port: dhcpv6.DefaultServerPort,
}
- server := server6.NewServer(laddr, handler)
-
- defer server.Close()
- if err := server.ActivateAndServe(); err != nil {
- log.Panic(err)
+ server, err := server6.NewServer(laddr, handler)
+ if err != nil {
+ log.Fatal(err)
}
+
+ server.Serve()
}