1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

net: remove sockets if they already exists (#11264)

This commit is contained in:
Simon
2021-08-22 12:38:02 +02:00
committed by GitHub
parent 2e28c9a4d6
commit ed06c47a51
2 changed files with 6 additions and 9 deletions

View File

@@ -3,14 +3,6 @@ import net.unix
const test_port = os.join_path(os.temp_dir(), 'unix_domain_socket')
fn testsuite_begin() {
os.rm(test_port) or {}
}
fn testsuite_end() {
os.rm(test_port) or {}
}
fn handle_conn(mut c unix.StreamConn) {
for {
mut buf := []byte{len: 100, init: 0}
@@ -50,6 +42,7 @@ fn echo() ? {
}
fn test_tcp() {
assert os.exists(test_port) == false
mut l := unix.listen_stream(test_port) or { panic(err) }
go echo_server(mut l)
echo() or { panic(err) }