Browse Source

dosth vorübergehend nil

test
Klaus Wendel 2 years ago
parent
commit
111868604c
  1. 5
      nhooyrioWebsocketAddons/nhooyrioWebsocketAddons.go

5
nhooyrioWebsocketAddons/nhooyrioWebsocketAddons.go

@ -3,7 +3,6 @@ package nhooyrioWebsocketAddons
import (
"context"
"encoding/json"
"fmt"
"nhooyr.io/websocket"
"nhooyr.io/websocket/wsjson"
@ -102,7 +101,6 @@ func (r *GosmBuffer) WsCommunicator(method string, ctx context.Context, conn *we
//WsCommunicator sends and receivs data to/from websocket partner
func (r *GosmContainer) WsCommunicator(method string, ctx context.Context, conn *websocket.Conn, dosth ...func(interface{}) interface{}) (error, websocket.MessageType) {
fmt.Println(*r)
switch {
case (method == "sendtext" || method == "sendbinary" || method == "send") && len(dosth) == 0:
err, receiveval := WsjsonSend(ctx, conn, *r)
@ -119,7 +117,6 @@ func (r *GosmContainer) WsCommunicator(method string, ctx context.Context, conn
//WsCommunicator sends and receivs data to/from websocket partner
func (r *GosmBuffer) WsCommunicator(method string, ctx context.Context, conn *websocket.Conn, dosth ...func(interface{}) interface{}) (error, websocket.MessageType) {
fmt.Println(*r)
switch {
case (method == "sendtext" || method == "send") && len(dosth) == 0:
err, receiveval := WsSend(ctx, conn, *r, websocket.MessageText)
@ -130,7 +127,7 @@ func (r *GosmBuffer) WsCommunicator(method string, ctx context.Context, conn *we
*r = GosmBuffer(receiveval)
return err, websocket.MessageBinary
case method == "receive" && len(dosth) == 1:
err, receiveval, mtr := WsReceive(ctx, conn, dosth[0])
err, receiveval, mtr := WsReceive(ctx, conn, nil) //dosth[0]
*r = GosmBuffer(receiveval)
return err, mtr
default:

Loading…
Cancel
Save