mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples: simplify examples/websocket/ping.v (end automatically, when the client ends)
This commit is contained in:
parent
7e1c45ab44
commit
f56aaa1007
@ -1,15 +1,12 @@
|
||||
module main
|
||||
|
||||
import time
|
||||
import os
|
||||
import net.websocket
|
||||
|
||||
fn main() {
|
||||
println('press enter to quit...\n')
|
||||
go start_server()
|
||||
time.sleep(100 * time.millisecond)
|
||||
go start_client()
|
||||
os.get_line()
|
||||
start_client()?
|
||||
}
|
||||
|
||||
// start_server starts the websocket server, it receives messages
|
||||
|
Loading…
Reference in New Issue
Block a user