mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
net: fix TcpConn.peer_ip/0 to only return the ip address, without the port number (#21831)
This commit is contained in:
parent
ca07347430
commit
547c056bf4
3 changed files with 16 additions and 1 deletions
|
@ -64,6 +64,10 @@ fn test_socket() {
|
|||
|
||||
fn test_socket_write_and_read() {
|
||||
mut server, mut client, mut socket := setup()
|
||||
addr := socket.peer_addr()!
|
||||
ip := socket.peer_ip()!
|
||||
assert ip in ['::1', 'localhost', '127.0.0.1']
|
||||
println('> ip: ${ip} | addr: ${addr}')
|
||||
defer {
|
||||
cleanup(mut server, mut client, mut socket)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue