code refactoring

This commit is contained in:
2023-11-19 13:52:51 +01:00
parent 710a8537e0
commit c56e3a106b
6 changed files with 1372 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ package rpc
import (
"io"
"log"
"net/http"
"github.com/gorilla/websocket"
@@ -29,6 +30,7 @@ func WebSocket(w http.ResponseWriter, r *http.Request) {
mtype, reader, err := c.NextReader()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
log.Println(err)
break
}
@@ -37,6 +39,7 @@ func WebSocket(w http.ResponseWriter, r *http.Request) {
writer, err := c.NextWriter(mtype)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
log.Println(err)
break
}