We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 97cb101 commit 1776fa1Copy full SHA for 1776fa1
README.md
@@ -144,6 +144,7 @@ type Listener struct {
144
SocketListener net.Listener
145
HasNewMessages func() bool
146
GetMessage func() string
147
+ Stop func()
148
}
149
```
150
@@ -177,6 +178,22 @@ func main() {
177
178
179
180
181
+`Stop()` function closes the listener connection:
182
+
183
+```go
184
+func main() {
185
+ r, _ := hare.Listen("3000")
186
+ hare.Send("3000", "Hey beauty")
187
188
+ r.Stop()
189
190
+ err := Send("3000", "This should fails")
191
+ if err != nil {
192
+ panic(err)
193
+ }
194
+}
195
+```
196
197
## Examples
198
199
You can check the [example](./examples) for code usages, like [send](./examples/send.go) and [listen](./examples/listen.go) samples.
0 commit comments