func (s *Server) WriteHandler(wh WriteHandler) {
	s.wh = wh
}
WriteHandler registers a WriteHandler for the server.
package tftp  
import (
	"net"
	"sync"
	"time"
)
type Server struct {
	log     *logger
	net     string
	addrStr string
	addr    *net.UDPAddr
	connMu  sync.RWMutex
	conn    *net.UDPConn
	close   chan struct{}
	singlePort bool
	dispatchChan chan *request
	reqDoneChan  chan string
	retransmit int  
	rh ReadHandler
	wh WriteHandler
}
type request struct {
	addr *net.UDPAddr
	pkt  []byte
}
func NewServer(addr string, opts ...ServerOpt) (*Server, error) {
	s := &Server{
		log:          newLogger("server"),
		net:          defaultUDPNet,
		addrStr:      addr,
		retransmit:   defaultRetransmit,
		dispatchChan: make(chan *request, 64),
		reqDoneChan:  make(chan string, 64),
		close:        make(chan struct{}),
	}
	for _, opt := range opts {
		if err := opt(s); err != nil {
			return nil, err
		}
	}
	return s, nil
}
func (s *Server) Addr() (*net.UDPAddr, error) {
	s.connMu.RLock()
	defer s.connMu.RUnlock()
	if s.conn == nil {
		return nil, ErrAddressNotAvailable
	}
	return s.conn.LocalAddr().(*net.UDPAddr), nil
}
func (s *Server) ReadHandler(rh ReadHandler) {
	s.rh = rh
}