1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/net/socket_test.v
Alexander Medvednikov 390394b56b string: make substr() copy the data, like in Java and C#; remove .cstr()
this makes managing memory used by strings much easier
V strings are now fully compatible with C strings
2019-07-22 17:03:45 +02:00

22 lines
430 B
Go

import net
fn test_socket() {
// server := net.listen(8080)
// println(server)
// client := net.dial('127.0.0.1', 8080)
// println(client)
// socket := server.accept()
// println(socket)
// message := 'Hello World'
// socket.send(message.str, message.len)
// println('Sent: ' + message)
// bytes := client.recv(1024)
// println('Received: ' + tos(bytes, message.len))
// server.close()
// client.close()
// socket.close()
}