即时消息 (IM) 如何工作(收听)?
我的任务是为内部和外部员工编写一个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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
连接到路由器后面的系统非常复杂,而且并不总是可行。使用 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.