开发者

How messengers (IM) works (listening)?

My task is to write a Messenger program for both internal and external staffs, I actually made it. Howeve开发者_开发技巧r, 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!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜