Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local handle, err = http.websocket("ws://99.3.41.97:8080")
- function receive()
- while true do
- print(handle.receive())
- end
- end
- function send()
- while true do
- handle.send(read())
- end
- end
- function ping()
- while true do
- sleep(10)
- handle.send("ping")
- end
- end
- if not handle then
- printError(err)
- else
- parallel.waitForAny(receive, send, ping)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement