How to make a direct connection in DotNet?
I will develope a programm that:
- connect 2 PCs
- 1 will be server, 1 will be client
- Languag开发者_如何转开发e C#.net 2.0
- like a chat
Con somepne give me a start-howto or something I can read, how I can connect 2 PCs aand send text messages to each other?
I will not use .Net 3.5, of severeal reasons.
This article provides chat development tutorial using c#.
Read up - lowest level - how SOCKETS and TCP works.
Next one would be getting into WCF which is a higher abstraction level. I would use WCF here.
If you have a limitation of .net 2.0 you can have a look at the TCP Client . If not, you could bump up to .NET 3.5 and use WCF.
One option is to create a WCF service on the server. It will let you keep out of some of the details of lower level network programming with sockets. See for example this WCF .Tutorial
If you want to learn "real" network programming you should look into using TCP or UDP sockets.
I think XMPP/Jabber will do exactly what you want. Take a look at jabber.net and the examples. Jabber requires a federated server for instance gmail/google and many others or you can host your own. I had good luck with the open source and free OpenFire.
Another possibility for direction connection is Skype via its skype4com.dll.
精彩评论