HFish/core/protocol/tftp/tftp.go

28 lines
458 B
Go
Raw Normal View History

2019-10-28 22:25:23 +08:00
package tftp
import (
"HFish/core/protocol/tftp/libs"
"fmt"
"io"
"os"
"time"
)
func readHandler(filename string, rf io.ReaderFrom) error {
return nil
}
func writeHandler(filename string, wt io.WriterTo) error {
return nil
}
func Start(address string) {
s := libs.NewServer(readHandler, writeHandler)
s.SetTimeout(5 * time.Second)
err := s.ListenAndServe(address)
if err != nil {
fmt.Fprintf(os.Stdout, "server: %v\n", err)
os.Exit(1)
}
}