~fnux/yggdrasil-go-coap

4edce7c76b18b66dc609ec1b9527c422be27e08f — Timothée Floure 1 year, 7 months ago 7685295
Fix server ActiveAndServe (called by client) to work with yggdrasil
1 files changed, 6 insertions(+), 0 deletions(-)

M server.go
M server.go => server.go +6 -0
@@ 14,6 14,7 @@ import (
	"time"

	coapNet "github.com/Fnux/go-coap/net"
	"github.com/yggdrasil-network/yggdrasil-go/src/yggdrasil"
	"github.com/pion/dtls"
)



@@ 382,6 383,11 @@ func (srv *Server) ActivateAndServe() error {
				srv.Net = "udp"
			}
			return srv.activateAndServe(nil, nil, coapNet.NewConnUDP(c, srv.heartBeat(), 2))
		case *yggdrasil.Conn:
			if srv.Net == "" {
				srv.Net = "yggdrasil"
			}
			return srv.activateAndServe(nil, coapNet.NewConn(c, srv.heartBeat()), nil)
		}
		return ErrInvalidServerConnParameter
	}