By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,715 Members | 1,219 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,715 IT Pros & Developers. It's quick & easy.

How to use multiple channels

P: n/a
i have two applications, which communicates very extrem together. With the
IPC-Channel i receive often the messages like "all instances of the
requested pipe are busy". So i want to use multiple Channels to communicate,
maybe 10 Connections.

For this scenario i created on each side 10 Servers and 10 Channels, each
Channel has a Number in its Name(for example myserver.0 to myserver.9 and
myclient.0 to myclient.9)

In The Activator.GetObject-Method, i use randomly one of the 10
Channel-Names. This works great.

But the Problem is, that all responses use only the first Client-Channel. An

dim Obj as TMyObject = Activator.GetObject(GetType(TMyObject),

Serversite: aMarshalObject.CallAnotherFunction - this use every time the
Clientchannel: ipc://myClient.0/ and never any other Channel.

Now the simple Question: How can i specifiy, what channel is used for a
Callback or a Callback of a Callback, ....?
If the an object is created manually(Activator.GetObject), i can specifiy
the Channel, but not if objects are created with New on Clientside.

Here's a detailed Example zu explain my Problem:

First the Server starts and do something:

Create 10 Server-Channels(and Receivers of course, too):

For each Server-Channel a Entrypoint(as WellKnownServiceType) will be

Now can start the Client-Application und creates some Channels(Senders &

No Objects should Registred, because the Server-Application never connects
a Client-Application.

No can the Remoting start. The Client call:
Dim Entry As EntryPoint =
Activator.GetObject(GetType(TRemoteWorkerProcessSt art),
"ipc://server.X/EntryPoint") 'X --> 0-9

dim ms as new IO.MemoryStream(...)

This Method change the Roles, now the Client-Application deliver a
Remote-Object(IO.Memorystream). I see in an Process-Explorer, that my
Clientapplication now communicates only over the *first* IPC-Client-Channel.
How can i specify, that my Client application should deliver the
MemoryStream on a specified Channel?

Now the second example. Maybe, we don't use a Memorystream. Let's say we use
a custom MarshalByRefObject, that my Client-Application have to send the
Server-Application. And now the Server want to send another
MarshalByRefObject back, as a new Call in the Stacktrace(not as a
Return-Message). This is the same Problem.

For information: All calls should be in the same Context as the first Call
in the Entrypoint(i dont mean a native .NET Context, i mean, that no
"shared" Objects should be delivered).
If you want to know, what my Application is: I wrote a custom
Webapplication(without using System.Web) as Windows-Service. A real
Webapplication(ASPX) ist the "Client-Application". If 10 Users call a
Webpage, all Calls should be on differen Channels, even the CallBacks.

And please don't ask me why i didn't write my Application directly in

Mar 3 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.