code: func NewPacketConn(s *stack.Stack, addr tcpip.FullAddress, network tcpip.NetworkProtocolNumber) (*PacketConn, error) {
  	// Create UDP endpoint and bind it.
  	var wq waiter.Queue
  	ep, err := s.NewEndpoint(udp.ProtocolNumber, network, &wq)
  	if err != nil {
  		return nil, errors.New(err.String())
  	}
  
  	if err := ep.Bind(addr); err != nil {
  		ep.Close()
  		return nil, &net.OpError{
  			Op:   "bind",
  			Net:  "udp",
  			Addr: fullToUDPAddr(addr),
  			Err:  errors.New(err.String()),
  		}
  	}
  
  	c := &PacketConn{
  		stack: s,
  		ep:    ep,
  		wq:    &wq,
  	}
  	c.deadlineTimer.init()
  	return c, nil
  }
docs: // NewPacketConn creates a new PacketConn.