I want to implement my idea, develop an application that will have client/server sides and make connection of clients to server, so they will be able to transfer messages in real-time.
So i will develop using C#, but the question is : what should i use? I dont know what method will be better for that chat. I need to choose between Net.Sockets, WCF and ASP.NET. So I ask you to help me with choise. If I use ASP.NET, I'll have to play with selfhost things, because I don't want to create a site, or something like this to use chat.
Firstly, let's start from your variants
Net.Sockets are too low level. It's hard to make acceptable protocol. But you can use existing protocol - WebSockets. There is a tutorial how to write websocket server on c#: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_server
Possibly, if you choose WCF, you can try to use WCF duplex persistent connection over netTcpBinding. It's easily to make self-hosting WCF-service. But WCF is complex and I think it's significant overhead for simple tasks. Also, as I know duplex connection works by using long polling, which wastes a lot of resources. Choose this variant carefully.
ASP.NET. If you are talking about MVC or Web Api you should use long polling, which wastes a lot of resources and isn't real realtime
There are another variant - ASP.NET SignalR (which works using WebSockets)