472,356 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

synchronization problem in remouting events handling

Hi,
I have got some problem with sending of events in .NET.
I am using remouting.
The client has got 2 objects for receiving different types of events
(responses and events)
The server has got two objects for sending of these events.
The client opens tcp port 0 to receive events:
if (ChannelServices.GetChannel("tcp") == null)

{

BinaryClientFormatterSinkProvider provider = new
BinaryClientFormatterSinkProvider();
IDictionary props = new Hashtable();

props["port"] = 0;
TcpChannel chan = new TcpChannel(props, provider, null);

ChannelServices.RegisterChannel( chan );

}

and the client supplies to the server 2 delegates for the different kinds of
the events. These callbacks are added to an event table.

When the event or the response occured , it is being sent to the client
from the thread corresponding to the event or response object.

The problem occurs when the server is sending simultaneously response and
event to the same client (from the different thread).

The client receives only the response (that is sent the first always). The
event is seems to be stuck in the delegate callback:

...........

printDebugMsg(string.Format("before sending of event
{0}",eventData.eventType));
cbDelegateEvent(obj,eventData);

printDebugMsg(string.Format("after sending of event
{0}",eventData.eventType));

............

I am receiving something like the following :

before sending of event RESPONSE

before sending of event EVENT

after sending of event RESPONSE.

And it's all.

I have added debug printings on the client side and saw that the event does
not arrive to the client at all.

After the client was disconnected from the server , it(the client) received
all the relevant stuck events.

I fixed the problem by synchronization of the response and event threads
thus that only one call to the client side can be processed at the same
time.

Cannot I send 2 events from the 2 threads to the same client at the same
time?

I wouldn't want to use synchronization. Maybe there is another solution
(something with RegisterChannel )?

Thanks

Efim
Nov 15 '05 #1
0 1340

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

Similar topics

7
by: Ivan | last post by:
Hi I have following problem: I'm creating two threads who are performing some tasks. When one thread finished I would like to restart her again (e.g. new job). Following example demonstrates...
7
by: Ivan | last post by:
Hi there My work on threads continues with more or less success. Here is what I'm trying to do: Class JobAgent is incharged for some tasks and when it's called it starts thread which performs...
5
by: Bill Davidson | last post by:
Hello All: I've got a question about synchronization requiremements in a C# worker thread procedure that, among other things, sinks events from outside sources. I realize the worker thread will...
1
by: Bill Davidson | last post by:
(RESEND: I added a little more code to the sample for clarity) Hello All: I've got a question about synchronization requiremements in a C# worker thread procedure that, among other things,...
12
by: scsharma | last post by:
Hi, I am working on creating a webapplication and my design calls for creating main webform which will have menu bar on left hand side and a IFrame which will contain all the forms that are shown...
7
by: Robert | last post by:
Hi, I have noticed some synchronization issues when using javascript. I'll give you an example. It is easy to reproduce the problem if you can cause some delay in the webserver before sending...
5
by: fei.liu | last post by:
Hello, in the application I am developing, I am having trouble to synchronize event triggered actions using 'lock(ob){...};' technique. Here is a outline of my code: class C{ int x = 0; public...
12
by: emma_middlebrook | last post by:
Hi Say you had N threads doing some jobs (not from a shared queue or anything like that, they each know how to do their own set of jobs in a self-contained way). How can you coordinate them so...
5
by: Tony Gravagno | last post by:
I have a class that instantiates two Timer objects that fire at different intervals. My class can be instantiated within a Windows Form or from a Windows Service. Actions performed by one of the...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.