Skip to content

Commit

Permalink
add windows code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eddycjy committed Nov 30, 2018
1 parent 39b5fc9 commit ad2b0d2
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package main
import (
"fmt"
"log"
"net/http"
"runtime"
"syscall"

"github.com/fvbock/endless"
Expand Down Expand Up @@ -35,18 +33,17 @@ func main() {
endPoint := fmt.Sprintf(":%d", setting.ServerSetting.HttpPort)
maxHeaderBytes := 1 << 20

if runtime.GOOS == "windows" {
server := &http.Server{
Addr: endPoint,
Handler: routersInit,
ReadTimeout: readTimeout,
WriteTimeout: writeTimeout,
MaxHeaderBytes: maxHeaderBytes,
}

server.ListenAndServe()
return
}
// If it is windows, you should open and comment out the endless related code.
//server := &http.Server{
// Addr: endPoint,
// Handler: routersInit,
// ReadTimeout: readTimeout,
// WriteTimeout: writeTimeout,
// MaxHeaderBytes: maxHeaderBytes,
//}
//
//server.ListenAndServe()
//return

endless.DefaultReadTimeOut = readTimeout
endless.DefaultWriteTimeOut = writeTimeout
Expand Down

0 comments on commit ad2b0d2

Please sign in to comment.