1
0
forked from MTSR/mapserver

use tcp v4

This commit is contained in:
Thomas Rudin 2019-05-06 19:24:59 +02:00
parent eee305180f
commit 694afa65a5

View File

@ -4,6 +4,7 @@ import (
"mapserver/app" "mapserver/app"
"mapserver/bundle" "mapserver/bundle"
"mapserver/vfs" "mapserver/vfs"
"net"
"net/http" "net/http"
"strconv" "strconv"
@ -51,7 +52,12 @@ func Serve(ctx *app.App) {
mux.Handle("/api/mapblock/", &MapblockHandler{ctx: ctx}) mux.Handle("/api/mapblock/", &MapblockHandler{ctx: ctx})
} }
err := http.ListenAndServe(":"+strconv.Itoa(ctx.Config.Port), mux) server := &http.Server{Handler: mux}
l, err := net.Listen("tcp4", ":"+strconv.Itoa(ctx.Config.Port))
if err != nil {
panic(err)
}
err = server.Serve(l)
if err != nil { if err != nil {
panic(err) panic(err)
} }