From 8ce0c706393082adf344d271ba7d6e4fb760d557 Mon Sep 17 00:00:00 2001 From: CaiYueTing Date: Thu, 17 Aug 2023 18:12:44 +0800 Subject: [PATCH] fix: add option in example coode --- examples/options/server/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/options/server/main.go b/examples/options/server/main.go index d5e3ee6a..451e5104 100644 --- a/examples/options/server/main.go +++ b/examples/options/server/main.go @@ -60,10 +60,16 @@ func main() { m.Handle("/b", mux.HandlerFunc(handleB)) tcpOpts := []tcpServer.Option{} - tcpOpts = append(tcpOpts, options.WithMux(m), options.WithContext(context.Background())) + tcpOpts = append(tcpOpts, + options.WithMux(m), + options.WithContext(context.Background())) dtlsOpts := []dtlsServer.Option{} - dtlsOpts = append(dtlsOpts, options.WithMux(m), options.WithContext(context.Background())) + dtlsOpts = append(dtlsOpts, + options.WithMux(m), + options.WithContext(context.Background()), + options.WithOnNewConn(handleOnNewConn), + ) go func() { // serve a tcp server on :5686