Skip to content

Commit

Permalink
fixed: send recursion and url keep origin
Browse files Browse the repository at this point in the history
  • Loading branch information
lory committed Mar 13, 2024
1 parent 8530b7a commit aa38b18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 5 additions & 1 deletion socketx_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (w *SocketClient) Send(data []byte, to ...string) (n int, err error) {
}

func (w *SocketClient) SendJson(v interface{}, to ...string) (n int, err error) {
return w.SendJson(v, to...)
return w.sendJson(w.sock, v, to...)
}

func (w *SocketClient) Recv(length int) (msg *api.SockMessage, err error) {
Expand All @@ -75,6 +75,10 @@ func (w *SocketClient) send(s api.Socket, data []byte, to ...string) (n int, err
return s.Send(data, to...)
}

func (w *SocketClient) sendJson(s api.Socket, v interface{}, to ...string) (n int, err error) {
return s.SendJson(v, to...)
}

func (w *SocketClient) recv(s api.Socket, length int) (msg *api.SockMessage, err error) {
return s.Recv(length)
}
Expand Down
3 changes: 0 additions & 3 deletions socketx_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/civet148/log"
"github.com/civet148/socketx/api"
"github.com/civet148/socketx/types"
"strings"
"sync"
)

Expand Down Expand Up @@ -225,8 +224,6 @@ func (w *SocketServer) getClientAll() (clients []*SocketClient) {
}

func createSocket(url string, options ...api.SocketOption) (s api.Socket) {

url = strings.ToLower(url)
ui := parser.ParseUrl(url)
if len(options) != 0 {
opt := options[0]
Expand Down

0 comments on commit aa38b18

Please sign in to comment.