G
Guest
My problem is a bit difficult to explain, having a relatively limited
knowledge of .NET/C#, but please see if you can read between the lines.
I have an ASPX that, on load, initiates a call to a web service. The web
service attaches itself to a Win32 app's event (using a socket and
system.eventhandler), like the following:
connection.Listener.OnPublic += new PublicMessageEventHandler( OnPublic );
As far as I can tell, after that first web service method call (we'll call
Method #1), the events keep firing. Every time the socket app fires an
event, the eventhandler does it's thing.
I then have another method (part of the same class, in the same web service,
Method #2) that the page calls on interval to check in and see which events
were fired. I attempted to make Method #1 store its messages in a Session
object (actually an array in the Session object):
#1 (simplified):
Session["message"] = (string) StoredVal;
#2 (simplified):
RetrievedVal = (string) Session["message"] ;
Then #2 would pick them up. #1 can store, but #2 errors with something like
"must be set to an instance of an object". I realize that these are in two
entirely different contexts (#1 is HTTP and #2 is attached to Win32), but is
there a way to have the two communicate?
Just for fun, I tried making both use an ADO connection and communicate that
way and it works, but I would prefer a memory object of some sort (ie.
Session, XML, DBM, shared memory, etc.) I really have no idea what I'm
talking about, so I'm hoping someone can pose a creative solution. Please
include actual code in your post (sorry, I can't -- my code is very complex).
Thank you for your time.
knowledge of .NET/C#, but please see if you can read between the lines.
I have an ASPX that, on load, initiates a call to a web service. The web
service attaches itself to a Win32 app's event (using a socket and
system.eventhandler), like the following:
connection.Listener.OnPublic += new PublicMessageEventHandler( OnPublic );
As far as I can tell, after that first web service method call (we'll call
Method #1), the events keep firing. Every time the socket app fires an
event, the eventhandler does it's thing.
I then have another method (part of the same class, in the same web service,
Method #2) that the page calls on interval to check in and see which events
were fired. I attempted to make Method #1 store its messages in a Session
object (actually an array in the Session object):
#1 (simplified):
Session["message"] = (string) StoredVal;
#2 (simplified):
RetrievedVal = (string) Session["message"] ;
Then #2 would pick them up. #1 can store, but #2 errors with something like
"must be set to an instance of an object". I realize that these are in two
entirely different contexts (#1 is HTTP and #2 is attached to Win32), but is
there a way to have the two communicate?
Just for fun, I tried making both use an ADO connection and communicate that
way and it works, but I would prefer a memory object of some sort (ie.
Session, XML, DBM, shared memory, etc.) I really have no idea what I'm
talking about, so I'm hoping someone can pose a creative solution. Please
include actual code in your post (sorry, I can't -- my code is very complex).
Thank you for your time.