|
|
@ -102,14 +102,16 @@ 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.Print("ICH BIN HIER UND HIER GEHT WAS SCHIEF 0") |
|
|
|
switch { |
|
|
|
case (method == "sendtext" || method == "sendbinary" || method == "send") && len(dosth) == 0: |
|
|
|
err, receiveval := WsjsonSend(ctx, conn, *r) |
|
|
|
*r = receiveval.(GosmContainer) |
|
|
|
return err, websocket.MessageText |
|
|
|
case method == "receive" && len(dosth) == 1: |
|
|
|
fmt.Print("ICH BIN HIER UND HIER GEHT WAS SCHIEF 1") |
|
|
|
err, receiveval := WsjsonReceive(ctx, conn, dosth[0]) |
|
|
|
fmt.Print("ICH BIN HIER UND HIER GEHT WAS SCHIEF") |
|
|
|
fmt.Print("ICH BIN HIER UND HIER GEHT WAS SCHIEF 2") |
|
|
|
//*r = receiveval.(GosmContainer)
|
|
|
|
_ = receiveval |
|
|
|
return err, websocket.MessageText |
|
|
|