UDP声音连接遍历NAT [英] UDP Sound Connection Traversing NAT

查看:79
本文介绍了UDP声音连接遍历NAT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个使用远程处理来发送和接收声音的客户端服务器系统.它当前正在TCP/IP上运行,这对于具有良好连接的客户端来说是没有问题的.通过研究,我开始认为UDP连接可能有助于解决此问题.

我是这样想的吗?

如果是这样,我该怎么做.我已经尝试过了,但是它只连接了具有静态IP的客户端,我发现UDP在遍历NAT时遇到问题.
谁能告诉我一些客户端服务器连接的示例代码.在过去的两个星期中,我一直在浏览网络.

请帮助

I have created a client server system using remoting to transmit and receive sound. It is currently working on TCP/IP which is no problem for clients with a good connection. Through research I came to think that a UDP connection might help with this issue.

Am I right in thinking this?

If so how do I go about it. I have tried this but it only connects clients with a static IP and I found that UDP has problems traversing the NAT.

Could anyone show me some sample code of a client server connection please. I have been browsing the net for this for the last 2 weeks.

Please help

推荐答案

是的,只要您设置客户端,UDP就可以正常工作,以便它们可以容忍乱序和丢包.

诀窍是在NAT上建立UDP连接".有关如何执行此操作的很多信息:

http://www.google.com/search?q=UDP+across+NAT [ ^ ]

检查一下它们,不确定示例代码,但是这些链接应该使您对所涉及的内容有所了解.然后,您可以决定是否值得这样做.
Yes, UDP would work as long as you set up your clients so that they can tolerate out-of-order and dropped packets.

The trick is to set up a UDP "connection" across NAT. There''s lots of information about ways to do that:

http://www.google.com/search?q=UDP+across+NAT[^]

Check them out, not sure about sample code, but these links should give you an idea of what''s involved. Then you can decide if it''s worth doing or not.


这篇关于UDP声音连接遍历NAT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆