Expand
PollingDuplexHttpBinding Class
Silverlight

Represents a binding that a Silverlight version 4 client can use to configure endpoints that can communicate with Windows Communication Foundation (WCF) services that are similarly configured for duplex communication with a polling client.

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel.PollingDuplex (in System.ServiceModel.PollingDuplex.dll)
Syntax

'Declaration

Public Class PollingDuplexHttpBinding _
	Inherits Binding
'Usage

Dim instance As PollingDuplexHttpBinding
Remarks

Security is turned off by default, but can be added by setting the PollingDuplexHttpSecurityMode to a value other than None in the PollingDuplexHttpBinding(PollingDuplexHttpSecurityMode) constructor.

The binding is configured to use a binary message encoding and UTF-8 character encoding by default.

There are two time-outs on the PollingDuplexBindingElement used by this binding that are set to default values. ClientPollTimeout specifies the interval of time that a polling request has to complete before timing out; the default value is 5 minutes. The InactivityTimeout specifies the maximum interval of time that can pass without activity on a channel before it enters a faulted state; the default value is 10 minutes. The InactivityTimeout property can be used to change the default value directly on the binding. But value of thePollTimeout can be changed on the PollingDuplexBindingElement only when constructing a stack of binding elements for a CustomBinding.

Examples



			'Constructors set with different security modes
			Dim defaultNoSecurityPDBinding As New PollingDuplexHttpBinding()
			Dim transportSecurityPDBinding As New PollingDuplexHttpBinding(BasicHttpSecurityMode.Transport)
			Dim transportOnlySecurityPDBinding As New PollingDuplexHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly)

			'Output txtSecurityMode for binding with transport security: Transport
			Dim txtSecurityMode As String = transportSecurityPDBinding.Security.Mode.ToString()


			'Inactivity timeout
			Dim binding As New PollingDuplexHttpBinding()

			'Get default inactivity timeout
			Dim defaultInactivityTimeOut As TimeSpan = binding.InactivityTimeout
			'Returns default timeout in minutes: 10
			Dim txtDefaultInactivityTimeOut As String = defaultInactivityTimeOut.Minutes.ToString()

			'Set new inactivity timeout
			Dim newInactivityTimeOut As New TimeSpan(0, 5, 0)
			binding.InactivityTimeout = newInactivityTimeOut
			'Returns new timeout in minutes: 5
			Dim txtNewInactivityTimeOut As String = binding.InactivityTimeout.Minutes.ToString()

			Dim pollingDuplexBinding As New PollingDuplexHttpBinding()
			Dim bindingEC As BindingElementCollection = pollingDuplexBinding.CreateBindingElements()
			'Check on binding elements contained in the collection
			Dim boolHTBE As Boolean = bindingEC.Contains(GetType(HttpTransportBindingElement))
			'Returns true
			Dim txtboolHTBE As String = boolHTBE.ToString()
			Dim boolHSTBE As Boolean = bindingEC.Contains(GetType(HttpsTransportBindingElement))
			'Returns false
			Dim txtboolHSTBE As String = boolHSTBE.ToString()



Inheritance Hierarchy

System.Object
  System.ServiceModel.Channels.Binding
    System.ServiceModel.PollingDuplexHttpBinding
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Version Information

Silverlight

Supported in: 4, 3
Community ContentAdd
Advice against using session state with Polling Duplex
Description of an issue with session states:
http://blogs.msdn.com/silverlightws/archive/2010/05/05/the-case-of-null-httpcontext-current-session.aspx
Page view tracker