[Mono-bugs] [Bug 54671][Cri] New - OneWay attribute hangs on remote call.
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Fri, 20 Feb 2004 16:20:02 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by ryoung@novell.com.
http://bugzilla.ximian.com/show_bug.cgi?id=54671
--- shadow/54671 2004-02-20 16:20:02.000000000 -0500
+++ shadow/54671.tmp.26925 2004-02-20 16:20:02.000000000 -0500
@@ -0,0 +1,139 @@
+Bug#: 54671
+Product: Mono/Runtime
+Version: unspecified
+OS:
+OS Details: Redhat 9
+Status: NEW
+Resolution:
+Severity:
+Priority: Critical
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: ryoung@novell.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: OneWay attribute hangs on remote call.
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+When using the [OneWay] attribute on a method that will be invoked via
+remoting. The client will hang after 50 invocations of the call.
+
+
+Steps to reproduce the problem:
+1. Run the following code with the S option to run as a server.
+2. Run the code in another process with a 51 or greater option to run
+as a client.
+
+
+using System;
+using System.Runtime.Remoting.Messaging;
+using System.Collections;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+
+
+namespace Remote.Test
+{
+ public class RemoteTest
+ {
+ Server server;
+ private const string CFG_Uri = tcp://localhost:7654/Server";
+
+ public RemoteTest()
+ {
+ RegisterClientChannel();
+ server = new Server();
+ }
+
+ public static void Main(string [] args)
+ {
+ if (args.Length != 1)
+ {
+ Console.WriteLine("Usage: mono {0} S | count",
+System.Diagnostics.Process.GetCurrentProcess().ProcessName);
+ return;
+ }
+
+ switch (args[0])
+ {
+ case "S":
+ RegisterService();
+ Console.WriteLine("Press enter to exit:");
+ Console.ReadLine();
+ break;
+
+ default:
+ RemoteTest t = new RemoteTest();
+ int count = Int32.Parse(args[0]);
+ for (int i = 1; i <= count; ++i)
+ {
+ t.server.RemoteCall("Call " + i.ToString());
+ }
+ break;
+ }
+ }
+
+ public static void RegisterClientChannel()
+ {
+ Hashtable props = new Hashtable();
+ props["port"] = 0;
+
+ TcpClientChannel chan = new
+ TcpClientChannel(props,new
+ BinaryClientFormatterSinkProvider());
+ ChannelServices.RegisterChannel(chan);
+
+ string serviceUri = CFG_Uri;
+
+RemotingConfiguration.RegisterWellKnownClientType(typeof(Server),
+serviceUri);
+ }
+
+ public static void RegisterService()
+ {
+ Uri serviceUri = new Uri (CFG_Uri);
+ Hashtable props = new Hashtable();
+ props["port"] = serviceUri.Port;
+
+ TcpServerChannel chan = new
+ TcpServerChannel(props,new BinaryServerFormatterSinkProvider());
+ ChannelServices.RegisterChannel(chan);
+
+ RemotingConfiguration.RegisterWellKnownServiceType(
+ typeof(Server), serviceUri.AbsolutePath.TrimStart('/'),
+ WellKnownObjectMode.Singleton);
+ }
+ }
+
+
+ public class Server : MarshalByRefObject
+ {
+ static int callCount = 0;
+
+ [OneWay]
+ public void RemoteCall(string args)
+ {
+ Console.WriteLine("Recievied call {0}", ++callCount);
+ }
+ }
+}
+
+
+Actual Results:
+After 50 invocation the client hangs.
+
+
+Expected Results:
+It should keep running.
+
+
+How often does this happen?
+every time.
+
+
+Additional Information: