如何从同一个端口监听udp和tcp?

如何从同一个端口监听udp和tcp?

问题描述:

我正在使用socat

I am using socat

服务器-> socat TCP-LISTEN:4444 STDOUT || socat UDP:LISTEN:4444 STDOUT

客户端-> socat - UDP:localhost:4444

当我尝试与udp连接时,无法连接,但在TCP中会发生这种情况.我该怎么办? ,哪里出了错?

When I try to connect with udp, I cannot connect, but it happens with tcp. what should I do? ,where is the mistake?

快速浏览socat手册页显示UDP:LISTEN没有任何意义.

A quick look of the socat man page shows UDP:LISTEN doesn't make sense.

看起来像您想要的:

socat TCP-LISTEN:4444 STDOUT || socat UDP-LISTEN:4444 STDOUT

您输入的是错字,冒号而不是连字符.

You have a typo, colon instead of hyphen.