File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,10 @@ Different functions are given as an argument to register listeners
4848
4949 func onDisconnect (client scclient .Client , err error ) {
5050 fmt.Printf (" Error: %s \n " , err.Error ())
51- os.Exit (1 )
5251 }
5352
5453 func onConnectError (client scclient .Client , err error ) {
5554 fmt.Printf (" Error: %s \n " , err.Error ())
56- os.Exit (1 )
5755 }
5856
5957 func onSetAuthentication (client scclient .Client , token string ) {
@@ -63,6 +61,7 @@ Different functions are given as an argument to register listeners
6361
6462 func onAuthentication (client scclient .Client , isAuthenticated bool ) {
6563 fmt.Println (" Client authenticated :" , isAuthenticated)
64+ go startCode (client)
6665 }
6766
6867 func main () {
@@ -78,6 +77,11 @@ Different functions are given as an argument to register listeners
7877 // os.Exit(0)
7978 }
8079
80+ func startCode (client scclient .Client ) {
81+ // start writing your code from here
82+ // All emit, receive and publish events
83+ }
84+
8185```
8286
8387#### Connecting to server
Original file line number Diff line number Diff line change @@ -46,5 +46,5 @@ func main() {
4646}
4747
4848func start (client scclient.Client ) {
49-
49+ // start writing your code from here
5050}
You can’t perform that action at this time.
0 commit comments