Let me try and summarise what I think you are saying.

There are three actors - ClientA, ClientB and IISServer

The idea is that ClientA and ClientB want to talk to each other but for
some reason they can't talk to each other directly but they can talk to
IISServer.

Your proposal is as follows
1. ClientA talks to IISServer, IISServer records that ClientA has
connected
2. ClientB talks to IISServer, IISServer records that ClientB has
connected
3. ClientA talks to IISServer posting data for ClientB, IISServer notes
this data is for ClientB and stuffs it somewhere
4. ClientB talks to IISServer asking if there is any data, IISServer
sees it has data for ClientB and sends it.

If this is correct the theory sounds ok, looks basically like a
IIS-based message queue.  The only issue is resource usage where the
number of open connections held by clients could get quite high as you
would expect up to 2 open connections per client, one for sending data
and the other one waiting for a message.

Regards,
Chris

-----Original Message-----
From: Unmoderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Welborn
Sent: Thursday, 14 July 2005 1:22 AM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: [ADVANCED-DOTNET] Need advice on my Theory of Two way
communication Remoting

st1\:*{behavior:url(#default#ieooui) }
Good Morning



   Im hoping someone could at least give metheir opinion on this theory.
Seems like it would work when I modeled it out.But I might be missing
something.



   I am using snippets from code that I found atCodeProject. The url to
this code is: http://www.codeproject.com/csharp/2WayConnection.asp



   I will be referencing this code here.



What im thinking about doing is taking everything thats inthe Server app
(basically a Listener, but when sending it creates HTTP headersand body)
and creating an IIS Object out of it.

Here's how I think it could work:
(Before I get into this, the CLIENTB has a Firewall that’s
Outbound Only)


IIS Object(from here on out is referenced as just IIS): Singleton,
oninitialize creates a listener thread(Just like the server app), waits
forconnections

ClientA: Connects to IIS, IIS puts its CorrelationID(Possibly IP too)
insidethe Queue for later use.
For now lets say the CorrelationID for ClientA is 1.

ClientB: Connects to IIS, IIS puts its CorrelationID(Possibly IP too)
insidethe queue(NOTE: maybe not queue, but ArrayList) for later use.
ClientB's CorrelationID is 2.

Note that this queue, or ArrayList will hold the active Connection,
theconnection has not been closed at this time.



Im thinking by sending a package every few seconds it wouldkeep the
connection alive.

ClientA: Sends a ‘POST’ verb to IIS, the Body contains an
object[]that holds the information that I want IIS to send ClientB.



NOTE: Without having to download the code and seeing foryourself, the
Body property in this sample code is a Byte[], im hoping tochange that
to an Object[].

IIS: Receives the request, calls ProcessesRequest method, grabs the
Body, itthen parses the object[] and looks at the Index of it:

Index:
0: Verb that IIS is to use
1: The Remote IP that the command is going too
2: The Body that is to be sent to Remote IP

IIS: Then see's the Index[1]'s IP, Checks the queue, or ArrayList of
ActiveConnections and finds the Active Connection of the Remote
IP(ClientB, ID2)

IIS: Then creates the Headers and everything it needs, sets the Body to
theobject[] found in Index[2] and Fires off the Verb found in Index[0].

Ok, hope this makes sense what im about to explain. If you are familiar
withHTTP (or SOAP) you know that it has a header and body.



The ‘Verb’ would be like “GET” or
“POST”.

The ‘Body’ would be something like “HelloWorld”
if it was a string or any binary data you want to send.

The ‘Version’ would be “HTTP/1.1”



Make sense?



When the IIS Object gets the package from Client A, itwill open the
Object[] found in the Body and see what it is suppose to send toClientB

The Object[] would say something like this:
Object[] Index:

               0: “POST”

               1: 192.168.0.1 – ClientB’s IP

               2: object[] – the Data to Send ClientB



When the IIS Object see’s this, it will create itsown http headers
and after finding the Active Connection in the CollectionsObject
(ArrayList or Queue)

It will do this:



HttpMessage req = new HttpMessage();

req.Verb = (string)Object[0];// the “GET” or
“POST” command

req.RequestUri ="/";

req.Version ="HTTP/1.1";

req.Headers["Sequence-Num"] = 1;

req.Body = Object[2]; //the data to send to Client B



//Send Async

IAsyncResult async =_conn.BeginSendMessage(req);





ClientB sees the incoming request, grabs the object[] inthe Body and
processes it.
This object array will be the commands that I want it to do,
like'GetFolderList' or something like that.

It then processes my command, packs the return in an object[] of its
own.

Calls IIS and does the exact same process ClientA had to do to get the
packagehere.


Whew! Ok, does this sound like it would work?? Also, not knowing what
theoriginal data type is of the Body tag in Http, can I change the
byte[] toobject[]? That should be all im expecting to recieve in this
Body, no stringsor anything.



 Active Connections? Right now I am using straight..Net Remoting with
IIS and after making the connection I place the object in aSortedList, I
never have to make another connection I just reference the objectin the
SortedList.



  Does this qualify as an Active Connection? Wouldthis work with tcp
connections?

I hope you was able to follow me through this. Please help if you can. I
ampulling at straws and need some more direction.

Have a great afternoon.



 Steve































---------------------------------
Yahoo! Mail for Mobile
 Take Yahoo! Mail with you! Check email on your mobile phone.

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to