diff options
author | Martin Ashby <martin@ashbysoft.com> | 2018-05-18 22:49:25 +0000 |
---|---|---|
committer | Martin Ashby <martin@ashbysoft.com> | 2018-05-18 22:49:25 +0000 |
commit | 20ee809e540556801fca87a573852d16c2ac7388 (patch) | |
tree | 7fafc3115565c07f736d6bc6a42948a270e0a5f6 /Server.go | |
parent | d2dea8058c88b39f161178f59c6bfec0e32dfa02 (diff) | |
download | unicornpaint-20ee809e540556801fca87a573852d16c2ac7388.tar.gz unicornpaint-20ee809e540556801fca87a573852d16c2ac7388.tar.bz2 unicornpaint-20ee809e540556801fca87a573852d16c2ac7388.tar.xz unicornpaint-20ee809e540556801fca87a573852d16c2ac7388.zip |
Go server now working
Diffstat (limited to 'Server.go')
-rw-r--r-- | Server.go | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" "github.com/gorilla/websocket" - "github.com/veandco/go-sdl2/sdl" + //"github.com/veandco/go-sdl2/sdl" "io/ioutil" "log" "net/http" @@ -185,7 +185,7 @@ func upgradeHandler(w http.ResponseWriter, r *http.Request) { } } -func handleSdlEvents() { +/*func handleSdlEvents() { running := true for running { for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() { @@ -196,7 +196,7 @@ func handleSdlEvents() { } } } -} +}*/ func handleClients() { for { @@ -222,8 +222,9 @@ func main() { http.Handle("/", http.FileServer(http.Dir("build"))) http.HandleFunc("/ws", upgradeHandler) go http.ListenAndServe(":3001", nil) - go handleClients() - handleSdlEvents() + //go handleClients() + handleClients() + //handleSdlEvents() } func doBroadcast(obj interface{}) { |