Change h2quic.Server.Serve() to accept a net.PacketConn

This commit is contained in:
Lucas Clemente
2017-07-04 18:02:45 +02:00
parent bf8ae2bb50
commit bbf8977f64
2 changed files with 3 additions and 2 deletions

View File

@@ -69,11 +69,11 @@ func (s *Server) ListenAndServeTLS(certFile, keyFile string) error {
}
// Serve an existing UDP connection.
func (s *Server) Serve(conn *net.UDPConn) error {
func (s *Server) Serve(conn net.PacketConn) error {
return s.serveImpl(s.TLSConfig, conn)
}
func (s *Server) serveImpl(tlsConfig *tls.Config, conn *net.UDPConn) error {
func (s *Server) serveImpl(tlsConfig *tls.Config, conn net.PacketConn) error {
if s.Server == nil {
return errors.New("use of h2quic.Server without http.Server")
}