C# P2P chat application design

痴心易碎 提交于 2019-12-22 10:48:12

问题


I want to create a simple chat application that doesn't use an explicit server. The main requirement is that the user can simultaneously chat with many friends (just like on Skype etc.). I do not mean a conference chat here, just multiple separate chat-windows.

Currently, I want only a LAN messaging application but I'd appreciate, if the design was easy to extend to Internet connections.

I wonder what design is appropriate for such an application.

  • What do you think about a solution, where each user app has a TcpListener (the implicit server) and multiple TcpClient objects - one for each friend he/she is talking to.
  • What about authenticating the remote users? Should the chatting app generate a certificate (X509 or sth) or just assume that the users in a LAN are to be trusted :)

Kindest regards,


回答1:


HttpListener + WebClient(or HttpWebRequest) can provide you more tools for authentication/security. Basic Authentication, Ntlm, Integrated Windows Authentication, https etc. and they are more firewall friendly.




回答2:


You should see start with

how do i make my own P2P software?

WCF / WPF Chat Application

P2P Communication - Proxy Listeners and Proxy Clients

Hope this proves good starting point

Happy coding



来源:https://stackoverflow.com/questions/8683663/c-sharp-p2p-chat-application-design

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!