Did Wcf replace socket? for client server application i need that client send some messages to server and the server can do the same thing without waiting request from any client. So can i do this or wcf can only expose many services that client need and the communication can't be interactif and bidirectionnal? thanks
Asked
Active
Viewed 2,221 times
3
-
On a similar line of questioning: https://stackoverflow.com/questions/59456579/is-wcf-built-on-sockets – Sisir Dec 24 '19 at 06:46
2 Answers
4
Do you want the connection to be persistant? If so then this doesn't sound like a good case for WCF. Perhaps take a look at something like ZeroMQ instead.

OJ.
- 28,944
- 5
- 56
- 71
-
thanks OJ :my application is a simulator of tracking's unit by GPS/GPRS. So, i need a persistant connection between the unit and the server and i'am obliged to do this with wcf. can i do this or you think that it is difficult or impossible? any advices – Lamloumi Afif Apr 21 '12 at 21:49
-
2You can do this with WCF but I strongly feel that it's the wrong tool for the job. A basic socket abstraction is really all that's required, and ZeroMQ doe this kind of thing really well. WCF's overheads at build-time and runtime make it more painful than necessary. For your case, the abstractions aren't really going to give you much at all. May I ask why you're obliged to do this with WCF? Cheers! – OJ. Apr 21 '12 at 22:48
-
my boss would that the client uses socket and the server uses wcf but i don't know exactly what are the reasons!!! – Lamloumi Afif Apr 21 '12 at 22:58
-
Is your boss a technical person? Is it his place to make the call? These kinds of decisions should be made by technical people (leads and architects), not by business people. Sounds to me like your boss has no idea what WCF if he/she thinks they can just have a socket on one end and WCF at the other. The oversimplification of the issue reeks of misunderstanding. Ultimately, this is an implementation detail business people shouldn't care about. The goal is to solve the problem in the best way. For what you describe WCF is not that in my view. – OJ. Apr 22 '12 at 01:55
-
1Wcf on one side and socket on the other? Surely not technical, maybe stylist "get me one white and one red" – Apr 22 '12 at 07:16
2
Wcf will never replace the sockets. The WCF just implements some concrete protocols over the TCP so if you need something else like IP or even UDP you still need to use the sockets.
If you need a stable TCP connection you still need a socket. Also this discussion could be helpful for you. http://forums.silverlight.net/t/17502.aspx/2/10

AlexTheo
- 4,004
- 1
- 21
- 35
-
Yes the duplex channel is actually a double TCP connection so you have two connections one for post the data and the other one to receive it from server just read the link I mentioned. – AlexTheo Apr 21 '12 at 22:02
-
If i understood, the difference between socket and wcf duplex channel, in the manner of communication, is the number of channels : the server and the client can send and receive all the time without order; the client requests a service and the server post the result in the other channel or the server send a command to clients and they send validation or refusal. – Lamloumi Afif Apr 21 '12 at 23:16
-
Yes, there are two sockets, but again the "abstraction" gives you nothing, it actually takes things away. There is a lot of overhead that isn't worth the effort. – OJ. Apr 22 '12 at 01:53