PollingDuplexHttpBinding Constructor
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Initializes a new instance of the PollingDuplexHttpBinding class.
Namespace: System.ServiceModel
Assembly: System.ServiceModel.PollingDuplex (in System.ServiceModel.PollingDuplex.dll)
Syntax
'Declaration
Public Sub New
public PollingDuplexHttpBinding()
Remarks
This is the default constructor for this duplex binding and it uses the default values for the security and polling modes. The default value used for the PollingDuplexHttpSecurityMode is None, which specifies that the SOAP message is not secured and the client is not authenticated. The default value used for the PollingDuplexMode is SingleMessagesPerPoll(), which indicates that the server will return one message every time the client polls for a message and then close the polling connection. To create instances of the PollingDuplexHttpBinding class with non-default values for these modes, use the PollingDuplexHttpBinding(PollingDuplexHttpSecurityMode, PollingDuplexMode) constructor.
Examples
'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()
//Inactivity timeout
PollingDuplexHttpBinding binding = new PollingDuplexHttpBinding();
//Get default inactivity timeout
TimeSpan defaultInactivityTimeOut = binding.InactivityTimeout;
//Returns default timeout in minutes: 10
string txtDefaultInactivityTimeOut = defaultInactivityTimeOut.Minutes.ToString();
//Set new inactivity timeout
TimeSpan newInactivityTimeOut = new TimeSpan(0, 5, 0);
binding.InactivityTimeout = newInactivityTimeOut;
//Returns new timeout in minutes: 5
string txtNewInactivityTimeOut = binding.InactivityTimeout.Minutes.ToString();
Version Information
Silverlight
Supported in: 5, 4, 3
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.