Posts

Showing posts with the label WCF

ASP.NET WCF Service Bindings

WCF supports different protocols for communicating with the other services and allowing access to client. This blog describes the difference between different protocols used with WCF services. BasicHttpBinding:   It uses HTTP transport protocol and it is of text/xml message encoding type. It does not support security. There is no reliability and also It does not support transactions. WSHttpBinding:  It uses HTTP/HTTPS transport protocol. It is a secure and inter-operable binding and It supports Message security. Reliability is disabled by default. It support WS- Atomic Transactions. WSDualHttpBinding:  It uses HTTP transport protocol and reliable messaging is enabled by default. It support WS- Atomic Transactions. NetTcpBinding:   It uses TCP as a transport protocol and It supports Binary Message encoding. also, It supports Transport security mode. Reliable messaging is disabled and it supports OLE Transactions. NetPeerTcpBinding:   It supports P2P t...

System.InsufficientMemoryException: Insufficient winsock resources available to complete when working with WCF

Some times when calling API's or web services we will get memory leakage exceptions in .Net like blow EXCEPTION: System.InsufficientMemoryException: Insufficient winsock resources available to complete socket connection initiation. ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 10.7.162.159:808 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout) So, it seems s ome where in the api's or web service or wcf program logic, network related objects used and those are not disposed hence causing the above mentioned exception. What exactly happening when you use network streams open is, your computer might have limited connections and you are creating and not disposi...