I have been doing more reading, and think the delegate option would be best,
however there are a few missing links....
Dim dele As New GC(AddressOf objRemote.GetCityNames)
Dim ar As IAsyncResult = dele.BeginInvoke(TextBox1.Text, Nothing, Nothing)
ar.AsyncWaitHandle.WaitOne(50, False)
If ar.IsCompleted = True Then
ListBox1.DataSource = dele.EndInvoke(ar)
End If
system still pauses and blocks during endenvoke.
ar.iscompleted always returns true.
if I use me.begininvoke, I have to handle application.exceptions and
override it to return the exception.
Please advise.
[quoted text, click to view] "Christopher Schipper" <admin@berries.com> wrote in message
news:uou0R8RcFHA.2984@TK2MSFTNGP15.phx.gbl...
> I'm working on wiring up some remoting to my website, and have a few
> questions I can't seem to find answers for online. For one the server code
> below doesn't matter because the question is related to when the server is
> OFFLINE.
>
> I'll be calling the remote server from a asp.net page and would like to
> set the timeout to <100ms before generating a no server responded to the
> request error message.
>
> I've scoured the net and found interesting articles about using async
> delegates that didn't work because the exception would be thrown out of
> process and cause a jit exception window. (Sorry the testing is being done
> via winforms)
>
> So I have read that tcp has no timeout (bummer) and using the http timeout
> property does no good for the connection itself (it always times out
> between 400-600ms regardless of the property setting)
>
> Has anyone been able to limit remoting and set a timeout for establishing
> a connection. (NOT execution time)
>
> The goal is to bypass a non critical function in a few ms as there will be
> thousands of clients connected and I cannot have them all wait 500ms to
> generate exceptions.
>
> Thank you.
>
> ps. I've looked at commercial packages, so please only post a valuable
> reply not an advertisement.
> ____________________________________________________
>
> Client:
>
> Dim objRemote As IAddressData = Activator.GetObject(GetType(IAddressData),
> "tcp://localhost:4000/remote.rem")
> 'Dim objRemote As IAddressData =
> Activator.GetObject(GetType(IAddressData),
> "http://localhost:4001/remote.rem")
> 'objHTTPChannel.Properties("timeout") = 50
>
> SUB
> ListBox1.DataSource = objRemote.GetCityNames(TextBox1.Text)
> END SUB
>
> ____________________________________________________
>
> Server:
> ChannelServices.RegisterChannel(New TcpServerChannel(4000))
> ChannelServices.RegisterChannel(New HttpChannel(4001))
> RemotingConfiguration.ApplicationName = "RemoteServer"
> RemotingConfiguration.RegisterWellKnownServiceType(GetType(SBI.REMOTE.ADDRESS.Server),
> "remote.rem", WellKnownObjectMode.Singleton)
>
> Console.ReadLine()
>
>