http://msdn.microsoft.com/library/de...classtopic.asp
Quite simply I want to specify a timeout property on a HTTP Channel I create.
VB Code:
Dim properties As New Hashtable() properties("timeout") = 10000 ' properties("name") = "HttpBinary" properties("port") = Convert.ToString(clientPort) properties("useDefaultCredentials") = True Dim svFormatter As New BinaryServerFormatterSinkProvider() Dim clFormatter As New BinaryClientFormatterSinkProvider() svFormatter.TypeFilterLevel = TypeFilterLevel.Full mRemotingChannel = New HttpChannel(properties, clFormatter, svFormatter)
However![]()
I get
System.ArgumentException: Bad or unexpected argument passed to channel constructor: timeout
at System.Runtime.Remoting.Channels.Http.HttpChannel..ctor(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider)
at vbBroadcast.Notification.InitRemoting(Int32 clientPort)
Any and all comments would be appreciated !
Ideally I would like to specify a time out period as our client applications hang and I am struggling to see why!![]()
Thanks in advance!
---
I have managed to resolve this problem.
Firstly I was trying to specify the timeout in the wrong place. I was attempting to specify the timeout on the initialisation of the server ! However THIS IS NOT correct. It is when you create your sever connction that you need to specify the timeout period! Thus
VB Code:
If mServer Is Nothing Then mServer = DirectCast(Activator.GetObject( _ GetType(Switchboard), notificationServerUrl), Switchboard) ChannelServices.GetChannelSinkProperties(mServer)("timeout") = TimeSpan.FromSeconds(10).TotalMilliseconds 'units appear to be miliseconds
Note that I also use GetChannelSinkProperties in order to specify the timeout period.
Thanks all,![]()





Reply With Quote