File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ func onAuthentication(client scclient.Client, isAuthenticated bool) {
3434
3535func main () {
3636 var reader scanner.Scanner
37- client := scclient .New ("ws://192.168.100.11 :8000/socketcluster/" );
37+ client := scclient .New ("ws://192.168.100.14 :8000/socketcluster/" );
3838 client .SetBasicListener (onConnect , onConnectError , onDisconnect )
3939 client .SetAuthenticationListener (onSetAuthentication , onAuthentication )
4040 go client .Connect ()
Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ func (client *Client) SetAuthenticationListener(onSetAuthentication func(client
4141func (client * Client ) registerCallbacks () {
4242
4343 client .socket .OnConnected = func (socket gowebsocket.Socket ) {
44+ client .sendHandshake ()
4445 if client .onConnect != nil {
4546 client .onConnect (* client )
4647 }
47- client .sendHandshake ()
4848 };
4949
5050 client .socket .OnConnectError = func (err error , socket gowebsocket.Socket ) {
@@ -106,9 +106,9 @@ func (client *Client) registerCallbacks() {
106106}
107107
108108func (client * Client ) Connect () {
109+ client .socket = gowebsocket .New (client .url )
109110 client .registerCallbacks ()
110111 // Connect
111- client .socket = gowebsocket .New (client .url )
112112 client .socket .Connect ()
113113}
114114
You can’t perform that action at this time.
0 commit comments