saghul / pyuv

Python interface for libuv
https://pyuv.readthedocs.io
MIT License
1.12k stars 105 forks source link

how to bind port both ipv4 and ipv6 #263

Closed wolance closed 4 years ago

wolance commented 4 years ago

图片 like this, but .. TCP.bind("", 1234), only one... how to use.... anybody 3q

i find handle.bind(("", TEST_PORT), pyuv.UV_UDP_REUSEADDR)

yes udp now work...but... i dont find tcp...how to set...no UVTCP...

saghul commented 4 years ago

Try binding to "::"

wolance commented 4 years ago

Try binding to "::"

May not, use :: do bind ok ,like :::1234, Use 0.0.0.0 do bind ok ,like 0.0.0.0:1234 but I wanna like this ipv4 and ipv6 bind same one port, like picture. I try to bind twice, Error tall me address have used, I try to find UV_TCP_REUSEADDR, but no result. I find TCP.bind no parameter is flag like UDP.

saghul commented 4 years ago

bind takes two parameters. What I meant is to use "::" as your address. Like so: handle.bind("::", 1234)

wolance commented 4 years ago

bind takes two parameters. What I meant is to use "::" as your address. Like so: handle.bind("::", 1234)

ennnnn.....i know it....im serious.....yes i try it.. although look at one address like :::1234, it can recv ipv4 package......originally, i wanna look at two address,, 0.0.0.0:1234 and :::1234....always ignore it...3q... u are right...