即时消息 (IM) 如何工作(收听)?

发布于 2024-09-03 05:04:13 字数 273 浏览 2 评论 0原文

我的任务是为内部和外部员工编写一个Messenger程序,我确实做到了。然而,我认为这确实不是一个好方法,通过使用客户端软件从服务器保留“check-mesg”。所以我认为我只是在模拟IM程序。

我想让客户端应用程序成为一个监听服务器,并让用户在主服务器上没有“消息中心”的情况下进行 p2p 通话(除非发生离线消息)。问题是当我位于路由器后面时,如何告诉外部用户(其他客户端应用程序)我的位置?

那些其他 IM 程序也作为服务器运行在客户端计算机上吗?他们如何度过难关?

提前致谢!

My task is to write a Messenger program for both internal and external staffs, I actually made it. However, I thing this is really not a good approach by using the client software keep "check-mesg" from server. So I think I am just simulating the IM program.

I want to make the client app become a listening server, and let user p2p talking without a "mesg-centre" at the main server(unless offline mesg happen). The question is how do I tell the external user ( other client app ) my location while I am behind a router ?

Are those other IM programs running on the client machine as a server too? and how do they get through ?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦里梦着梦中梦 2024-09-10 05:04:13

连接到路由器后面的系统非常复杂,而且并不总是可行。使用 UDP 执行此操作的一种有据可查的方法是 STUN 协议(主要用于基于 SIP 的 VoIP)。如果无法到达路由器后面,则只能使用开放网络中的服务器作为中介(某些 P2P 系统也将连接良好的对等方提升为此类中介)。 SIP 使用 TURN 作为中介协议。 SIP 为客户找到正确解决方案的协议是 ICE< /a>.

另请参阅NAT 穿越

It's quite complicated to connect to systems behind a router and not always possible. A well-documented way to do this with UDP is the STUN protocol (used mainly for SIP-based VoIP). If it is not possible to get behind the router, you can only use a server in the open network as intermediator (some P2P systems also promote well-connected peers to such intermediators). SIP uses TURN for as intermediator protocol. SIP's protocol to find out the right solution for a client is ICE.

See also NAT traversal.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文