In WCF , when should a TCP binding be used?
I know the scenario when web browser is the WCF client. In that case HTTP is used.
But what are the scenarios for TCP ?
Thanks for ur replies.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basically, whenever you can! NetTcp is much more efficient than http – it’s encoding binary which saves a lot of bandwidth, and it has other properties which make it really really fast.
Trouble is: the other end of the communication (you always have a server and a client) also must understand this protocol. It’s .NET specific, so any non-.NET client will not able to use it.
Also, NetTcp doesn’t typically use port 80, so if you want to use it over the internet, you’ll have to open up ports on firewalls to let the traffic go through – not always easy and possible.
But if you have an intranet scenario – e.g. your company’s LAN environment – and you have .NET clients calling your WCF service, there’s no reason at all not to use NetTcp !