Click here to Skip to main content
15,908,581 members
Home / Discussions / C#
   

C#

 
JokeRe: What are trees doing in your pants? Pin
Naruki15-Apr-09 16:54
Naruki15-Apr-09 16:54 
GeneralRe: What are trees doing in your pants? Pin
Neville Franks15-Apr-09 18:00
Neville Franks15-Apr-09 18:00 
QuestionProgress while reading a file Pin
nike_arh15-Apr-09 10:38
nike_arh15-Apr-09 10:38 
AnswerRe: Progress while reading a file Pin
amtadhani15-Apr-09 10:45
amtadhani15-Apr-09 10:45 
GeneralRe: Progress while reading a file Pin
nike_arh15-Apr-09 10:53
nike_arh15-Apr-09 10:53 
AnswerRe: Progress while reading a file Pin
Luc Pattyn15-Apr-09 10:55
sitebuilderLuc Pattyn15-Apr-09 10:55 
GeneralRe: Progress while reading a file Pin
nike_arh15-Apr-09 11:14
nike_arh15-Apr-09 11:14 
GeneralRe: Progress while reading a file Pin
Luc Pattyn15-Apr-09 11:19
sitebuilderLuc Pattyn15-Apr-09 11:19 
QuestionList view question Pin
al3xutzu0015-Apr-09 10:03
al3xutzu0015-Apr-09 10:03 
AnswerRe: List view question Pin
Luc 64801115-Apr-09 10:07
Luc 64801115-Apr-09 10:07 
GeneralRe: List view question Pin
DaveyM6915-Apr-09 10:08
professionalDaveyM6915-Apr-09 10:08 
AnswerRe: List view question Pin
DaveyM6915-Apr-09 10:07
professionalDaveyM6915-Apr-09 10:07 
AnswerRe: List view question Pin
al3xutzu0015-Apr-09 10:10
al3xutzu0015-Apr-09 10:10 
Questionweb develpoment Pin
elazor15-Apr-09 9:46
elazor15-Apr-09 9:46 
AnswerRe: web develpoment Pin
buachaill cliste15-Apr-09 10:02
buachaill cliste15-Apr-09 10:02 
GeneralRe: web develpoment Pin
elazor15-Apr-09 19:14
elazor15-Apr-09 19:14 
QuestionSpreadsheet COM in window form application Pin
Binqing15-Apr-09 8:47
Binqing15-Apr-09 8:47 
AnswerRe: Spreadsheet COM in window form application Pin
buachaill cliste15-Apr-09 10:40
buachaill cliste15-Apr-09 10:40 
GeneralRe: Spreadsheet COM in window form application Pin
Binqing15-Apr-09 11:01
Binqing15-Apr-09 11:01 
QuestionCreating a DataTable with the data from an SQL SELECT statement Pin
stonebergftw15-Apr-09 8:31
stonebergftw15-Apr-09 8:31 
AnswerRe: Creating a DataTable with the data from an SQL SELECT statement Pin
PIEBALDconsult15-Apr-09 10:17
mvePIEBALDconsult15-Apr-09 10:17 
GeneralRe: Creating a DataTable with the data from an SQL SELECT statement Pin
stonebergftw15-Apr-09 11:02
stonebergftw15-Apr-09 11:02 
GeneralRe: Creating a DataTable with the data from an SQL SELECT statement Pin
PIEBALDconsult16-Apr-09 6:59
mvePIEBALDconsult16-Apr-09 6:59 
QuestionMultithreaded remoting in C# Pin
NickoT15-Apr-09 7:46
NickoT15-Apr-09 7:46 
Hi All,

I'm predominately a Java programmer usually but have been doing some work in C# of late and am having a problem I hope someone can shed some light on for me.

There is a client and a server component to the application I'm writing. The way it works is that the client connects to a lot of servers that are running on a LAN (31 to be precise). All the servers expose a singleton MarshalByRefObject that is used by the client to call methods on the servers.

The client, when run, attempts to connect to all the servers at once, spawning a thread for each connection which basically just does this:

<code>
while (true)
{
try
{
RemoteInterface ri = (RemoteInterface)Activator.GetObject(typeof(RemoteInterface), url);
cparams.Callback(connectParams.ServerNumber, ri);
break;
}
catch (Exception ex)
{
log.Error("Error connecting to server " + cparams.ServerNumber + ": '"+ ex.Message+"'");
}
}
</code>

So attempting to connect to the server repeatedly, executing a callback (then terminating) when it's successful or logging errors each time it times out (or some exception occurs).

The problem I'm having is that when, say, 30 of the servers are down, and 1 is connected remoting calls to that server's RemoteInterface delay for something like a minute when they are performed. It's almost as if the other threads attempting to connect to the other servers are interfering with the thread that's making the call on the RemoteInterface of the connected server. I'm really unfamiliar with Remoting as this is the first project I've worked on that uses it so any help with finding a possible cause of this slowdown would be greatly appreciated. It seems to me that there is some singleton resource being shared by all the remoting threads that's blocking them and letting only one through at a time? I really don't know enough about remoting to speculate.

Thanks in advance,
Nick
AnswerRe: Multithreaded remoting in C# [modified] Pin
DaveyM6915-Apr-09 9:45
professionalDaveyM6915-Apr-09 9:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.