VB.NET Remoting Requested service not found Exception

Continue from previous release Remoting-Sample-10.

Thanks to Philip Cheung who stress-tested the code and found the issue which he discovered that when using Remoting-Sample-10, if you send out 25,000 messages in one shot from server to client, it seems to stop at around 23,647. It will not be able to display all 25,000 data sent out by the server.

System.Runtime.Remoting.RemotingException: Requested service not found exception will be generated.

It is due to the objects (which are sent out as messages from server to client) time-out just before the client managed to display all of them.



Remember that it is necessary to implement leasing and sponsorship for remoting objects lifetime management when remoting is concerned, hence leasing and sponsorship must also be implemented for objects to be sent out as messages from either client or server or both.

http://msdn.microsoft.com/en-us/magazine/cc300474.aspx

The solution is to sponsor the lease of these messages by extending the time-out. In this enhancement, it is extended to 5 minutes. The default is 2 minutes.

http://msdn.microsoft.com/en-us/library/ms973907.aspx

Refer to Remoting-Sample-11 (VB.NET Visual Studio 2008 SP1).

Comments

Anonymous said…
very useful article. i can't download the sample code because the file is not found, please re-upload the sample code.. many thanks
Brandon Teoh said…
Ok. Uploaded to dropbox. Thx.
Anonymous said…
thanks for your fast response.
anyway, which one is better between remoting or socket?
Anonymous said…
hi..
i tried to modify your source code into first form as login form and then the second form as chat form.

i copy the same control and same source code to both of form. on login already successfully run but when to show form chat, error.

why that happens?

my idea is on form login, user send username and password to server and then server validate that parameter, if correct server send some parameter to client to show form2.