PDA

View Full Version : Gateway thread troubles


korda
06-23-2008, 02:55 PM
Kevin,
Is it possible to simplify the RPC message callbacks in the client demo program to avoid all problems with calls between threads?

I am sure you aware of this mess in SetInfoText() function. On one side we want GUI to be decoupled from data processing code, but it creates problems to access complex controls like a dataGridView...

mgenti
06-23-2008, 03:12 PM
Vlad,

Are you extending the example C# demo or is this apart of your custom application? If this is part of your custom application can you describe your programming environment such as which language and tools you are using?

korda
06-23-2008, 03:36 PM
So far this is an extension of c#client example provided by you.
Environment also suggested by you, C# Express 2008 from MS.

mgenti
06-23-2008, 04:15 PM
Vlad,

The XML-RPC.NET library uses Microsoft's .NET WebRequest (http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetrequeststream.as px) class asynchronously which underneath uses C#'s built in managed thread pool (http://msdn.microsoft.com/en-us/library/0ka9477y.aspx). This means when you use the XML-RPC.NET library asynchronously it is using separate threads for you so there is no need to add additional threads in this area. If you want to manage the threads that requests are sent and received on your own, than I would recommend switching to using XML-RPC.NET in a synchronous fashion.

What are the plans for the environment you will be using for your final application? Different libraries and different languages will behave differently in this area. If you are not using C# or XML-RPC.NET than you may not have this issue.

korda
06-23-2008, 04:25 PM
It is hard to tell now what language we would use for final application to manage hundreds of RFEs. We used VC++ and Borland C Builder, but never yet C#. So I am not sure if C# is what we need, considering all the problems.
At the moment we are using it ONLY because you had gateway example for it. If you had this example in VC++ or other, this would make life easier for us.

What are penalties and advantages using synchronous RPC calls for RFE apps?

mgenti
06-23-2008, 08:12 PM
So I am not sure if C# is what we need, considering all the problems.


The problems you have been describing in this thread you may or may not experience using a different library or language. XML-RPC does not limit you to using C# as your programming language. Also you may find that another C# XML-RPC library's API is better for the application you are writing. We choose XML-RPC.NET since it was recommended by Microsoft, however there are other library's available.


What are penalties and advantages using synchronous RPC calls for RFE apps?

:)
This is one of the those questions that programmers love to go back and forth debating the advantages and disadvantages of synchronous versus asynchronous programming. In most languages, including C#, you will find ways of doing either so we would recommend using the method that you feel most comfortable with. Most of the developers here at Synapse prefer to use asynchronous APIs where possible but there is a time and place for each method.


At the moment we are using it ONLY because you had gateway example for it. If you had this example in VC++ or other, this would make life easier for us.


It is certainly possible to continue to use the provided C# example as a reference and program your application in C++. The calls you make in the C# application will be the same as in your C++.