473,385 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How do I handle this syncornization with remoting?

Hello,

I'm just starting with .NET remoting. Here is what I'm not sure how to
handle.

I have a IPC Channel remoting server. It exports an object and I can call a
method on that object just fine. I'd like to kick off some activity and
block until the activity completes.

The completion arrives as a COM call back on a thread from the COM object so
really my question is:

What is a straight forward .NET way to have the .NET remote call block on
something and then be released?

Thanks!
--
Grant Schenck
Sep 12 '06 #1
4 1436
Grant,

There are a few things here that don't make sense. See inline:
I'm just starting with .NET remoting. Here is what I'm not sure how to
handle.

I have a IPC Channel remoting server. It exports an object and I can call
a method on that object just fine. I'd like to kick off some activity and
block until the activity completes.
If you just make a regular call across a remoting channel, the call
blocks until the method is complete. Your code doesn't continue to execute
while the proxy on the client side is waiting for the call on the server to
complete.
The completion arrives as a COM call back on a thread from the COM object
so really my question is:
That doesn't make sense. What is a "COM call back" (I'm thinking
connection points here, but that makes no sense in this context). Are you
exporting an unmanaged COM object as a remoting endpoint? If so, that's
probably a bad, bad idea.

How is COM involved in this?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
>
What is a straight forward .NET way to have the .NET remote call block on
something and then be released?

Thanks!
--
Grant Schenck


Sep 12 '06 #2
Hi Nicholas,

Thanks for responding. See below...
--
Grant Schenck

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:eb**************@TK2MSFTNGP03.phx.gbl...
Grant,

There are a few things here that don't make sense. See inline:
>I'm just starting with .NET remoting. Here is what I'm not sure how to
handle.

I have a IPC Channel remoting server. It exports an object and I can
call a method on that object just fine. I'd like to kick off some
activity and block until the activity completes.

If you just make a regular call across a remoting channel, the call
blocks until the method is complete. Your code doesn't continue to
execute while the proxy on the client side is waiting for the call on the
server to complete.
[GRANT] Correct, the client blocks until I eventually complete.
>The completion arrives as a COM call back on a thread from the COM object
so really my question is:

That doesn't make sense. What is a "COM call back" (I'm thinking
connection points here, but that makes no sense in this context). Are you
exporting an unmanaged COM object as a remoting endpoint? If so, that's
probably a bad, bad idea.

How is COM involved in this?
[GRANT] I use an unmanged COM object which provides call backs to the
service. This part works fine. The connection to remoting is that the
request which comes in via remoting to the server does some setup and then
needs to block until an asyncronous event arrives at the COM object.

What I want to do in the remoted method in the server is:
- Setup some stuff.
- Create some kind of signalling object
- Block waiting for the object to signal.

The other thread (the fact that it is COM is really not relevent) at some
point completes the work intiiated by the setup and then needs to signal the
blocked method to release it and allow it to complete and therefore the
client to returned to. It may take up to a minute before the request
completes.

Basicly I'm building a command line utility which talks to a server via an
IPC channel. This server uses the services of a COM object to place a call
but I don't want to complete the method until the call connects or I want to
give up watiing for the call to connect. Therefore, I need a way to release
the waiting method from a separate thread which handles events generated by
the COM object.
>

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
>>
What is a straight forward .NET way to have the .NET remote call block on
something and then be released?

Thanks!
--
Grant Schenck



Sep 12 '06 #3
Grant,

In this case, what you want to do is create a WaitHandle (a
ManualResetEvent works fine). In the method that makes the call to your COM
object, you make a call to WaitOne after you make the async call to the COM
object.

Then, in the callback for the async operation on the COM object, you
call Set on the ManualResetEvent and it will release the thread and then
return from the server (of course, you have to set any return values in a
location that the waiting method can access).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Grant Schenck" <sc******@optonline.netwrote in message
news:u8**************@TK2MSFTNGP04.phx.gbl...
Hi Nicholas,

Thanks for responding. See below...
--
Grant Schenck

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:eb**************@TK2MSFTNGP03.phx.gbl...
>Grant,

There are a few things here that don't make sense. See inline:
>>I'm just starting with .NET remoting. Here is what I'm not sure how to
handle.

I have a IPC Channel remoting server. It exports an object and I can
call a method on that object just fine. I'd like to kick off some
activity and block until the activity completes.

If you just make a regular call across a remoting channel, the call
blocks until the method is complete. Your code doesn't continue to
execute while the proxy on the client side is waiting for the call on the
server to complete.

[GRANT] Correct, the client blocks until I eventually complete.
>>The completion arrives as a COM call back on a thread from the COM
object so really my question is:

That doesn't make sense. What is a "COM call back" (I'm thinking
connection points here, but that makes no sense in this context). Are
you exporting an unmanaged COM object as a remoting endpoint? If so,
that's probably a bad, bad idea.

How is COM involved in this?

[GRANT] I use an unmanged COM object which provides call backs to the
service. This part works fine. The connection to remoting is that the
request which comes in via remoting to the server does some setup and then
needs to block until an asyncronous event arrives at the COM object.

What I want to do in the remoted method in the server is:
- Setup some stuff.
- Create some kind of signalling object
- Block waiting for the object to signal.

The other thread (the fact that it is COM is really not relevent) at some
point completes the work intiiated by the setup and then needs to signal
the blocked method to release it and allow it to complete and therefore
the client to returned to. It may take up to a minute before the request
completes.

Basicly I'm building a command line utility which talks to a server via an
IPC channel. This server uses the services of a COM object to place a
call but I don't want to complete the method until the call connects or I
want to give up watiing for the call to connect. Therefore, I need a way
to release the waiting method from a separate thread which handles events
generated by the COM object.
>>

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
>>>
What is a straight forward .NET way to have the .NET remote call block
on something and then be released?

Thanks!
--
Grant Schenck




Sep 13 '06 #4
Thanks!

I think you nailed what I'm trying to do to a "T"!

I'll code it up tomorrow!

Grant

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:%2****************@TK2MSFTNGP02.phx.gbl...
Grant,

In this case, what you want to do is create a WaitHandle (a
ManualResetEvent works fine). In the method that makes the call to your
COM object, you make a call to WaitOne after you make the async call to
the COM object.

Then, in the callback for the async operation on the COM object, you
call Set on the ManualResetEvent and it will release the thread and then
return from the server (of course, you have to set any return values in a
location that the waiting method can access).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Grant Schenck" <sc******@optonline.netwrote in message
news:u8**************@TK2MSFTNGP04.phx.gbl...
>Hi Nicholas,

Thanks for responding. See below...
--
Grant Schenck

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:eb**************@TK2MSFTNGP03.phx.gbl...
>>Grant,

There are a few things here that don't make sense. See inline:

I'm just starting with .NET remoting. Here is what I'm not sure how to
handle.

I have a IPC Channel remoting server. It exports an object and I can
call a method on that object just fine. I'd like to kick off some
activity and block until the activity completes.

If you just make a regular call across a remoting channel, the call
blocks until the method is complete. Your code doesn't continue to
execute while the proxy on the client side is waiting for the call on
the server to complete.

[GRANT] Correct, the client blocks until I eventually complete.
>>>The completion arrives as a COM call back on a thread from the COM
object so really my question is:

That doesn't make sense. What is a "COM call back" (I'm thinking
connection points here, but that makes no sense in this context). Are
you exporting an unmanaged COM object as a remoting endpoint? If so,
that's probably a bad, bad idea.

How is COM involved in this?

[GRANT] I use an unmanged COM object which provides call backs to the
service. This part works fine. The connection to remoting is that the
request which comes in via remoting to the server does some setup and
then needs to block until an asyncronous event arrives at the COM object.

What I want to do in the remoted method in the server is:
- Setup some stuff.
- Create some kind of signalling object
- Block waiting for the object to signal.

The other thread (the fact that it is COM is really not relevent) at some
point completes the work intiiated by the setup and then needs to signal
the blocked method to release it and allow it to complete and therefore
the client to returned to. It may take up to a minute before the request
completes.

Basicly I'm building a command line utility which talks to a server via
an IPC channel. This server uses the services of a COM object to place a
call but I don't want to complete the method until the call connects or I
want to give up watiing for the call to connect. Therefore, I need a way
to release the waiting method from a separate thread which handles events
generated by the COM object.
>>>

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
What is a straight forward .NET way to have the .NET remote call block
on something and then be released?

Thanks!
--
Grant Schenck




Sep 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed...
5
by: Steve - DND | last post by:
Is it possible to do something like what this chapter excerpt shows, except for just a regular non-remoting bunch of code? http://www.microsoft.com/mspress/books/sampchap/6172a.asp The reason...
1
by: Mark | last post by:
I have a window handle to a richedit control running in a separate process within our .net application framework. Is there a simple way in .net to use the handle to get to the instance of the actual...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS...
0
by: Martijn Damen | last post by:
Hi, At the moment I am trying to develop an application that uses another app over .net remoting and having some problems with it (ok, that is ofcourse why I am here), hope somebody can shine a...
8
by: Raju Joseph | last post by:
Hi All, I am just trying to get an opinion here. I know this is always a tough choice to make. We are in the process of converting our VB6 based Healthcare Information System (a full-fledged...
1
by: srikanthmuvva | last post by:
i creatd a groove syncornization for one of my folder how i will able to remove this from the groove syncornization?
2
by: srikanthmuvva | last post by:
i need some information abou the groove syncornization
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.