Ok, I shall try to describe client algorithm.
1. Configure remoting infrastructure with follow config file:
-----------------------------------------------
<system.runtime.remoting>
<channelSinkProviders>
<clientProviders>
<provider id="CustomProvider" type="ClassName, AssemblyName"/>
</clientProviders>
</channelSinkProviders>
<application>
<channels>
<channel ref="tcp">
<clientProviders>
<formatter ref="binary" />
<provider ref="CustomProvider" />
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
-----------------------------------------------
"CustomProvider" creates simple filter sink that only fill some message
headers, but is some cases it can result it additional network round trip.2. Obtain remoting reference to server object by call to Activator.GetObject(ObjType, ObjUri).
3. Call server methods. All parameters are marshaled by value (Int32, Int64, string, bool, two custom classes, byte[]).
That's it. I hope it will be helpful.
Cheers, Andrey Shvydky
Stoyan Damov wrote:
Well, that's about the maximum number of sockets you can create on your Windows machine (mine is in the same range). I think Shawn Van Ness had written an utility to measure that maximum, but I'm not really sure (or maybe it was a Developmentor guy?) I know this doesn't solve your problem, but you can help me help you if you tell me how your client works...
Cheers, Stoyan
-----Original Message----- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Andrey Shvydky Sent: Monday, January 12, 2004 6:00 PM To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] TcpChannel and TIME_WAIT sockets
Hi,
I am using TcpChannel and binary serialization to call remoted singleton object on port 8090 (MarshalByRefObject without events). After 3500 - 4000 calls on *CLIENT* side I have the next error:
"Only one usage of each socket address (protocol/network address/por t) is normally permitted
Server stack trace: at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket() at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machineAndPort) at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.Se ndRequestWithRetry(IMessage msg, ITransportHeaders r equestHeaders, Stream requestStream) at ................... "
On the client side, netstat utility shows me many opened sockets in state TIME_WAIT to server port 8090. Having regard to thay quantity it seems that remoting infrastructure create new TCP connection and close it on every remoting call. But MSDN says: "The TcpChannel opens and caches as many connections as there are threads making requests to another server at that moment. Socket connections are closed on the client after 15-20 seconds of inactivity."
Can you help me?
-- Andrey Shvydky
=================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in:
NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls
View archives and manage your subscription(s) at http://discuss.develop.com
