How to use multiple channels

  • Thread starter Sebastian Loncar
  • Start date
S

Sebastian Loncar

Hi,
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
example:

dim Obj as TMyObject = Activator.GetObject(GetType(TMyObject),
"ipc://myserver.0/MyObject")
Obj.ExecFunction(aMarshalObject)

Serversite: aMarshalObject.CallAnotherFunction - this use every time the
first
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):
ipc://server.0
ipc://server.1
ipc://server.2
....
ipc://server.9

For each Server-Channel a Entrypoint(as WellKnownServiceType) will be
createt:
ipc://server.0/EntryPoint
ipc://server.1/EntryPoint
ipc://server.2/EntryPoint
....
ipc://server.9/EntryPoint

Now can start the Client-Application und creates some Channels(Senders &
Receivers):
ipc://client.0
ipc://client.1
ipc://client.2
....
ipc://client.9

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

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

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

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
ASP.NET ;)

Sebastian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top