Skip to content

Commit ce7c842

Browse files
committed
updated doc
1 parent 9b202df commit ce7c842

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ func main() {
4646
}
4747

4848
func start(client scclient.Client) {
49-
49+
// start writing your code from here
5050
}

0 commit comments

Comments
 (0)