Sorry I cannot post the code but here is what is happening in detail.
User opens a form it adds an event listener like:
GP.GlobalInfo.CommWCF.serviceClient.GetFilteredMessageCompleted += new EventHandler<GetFilteredMessageCompletedEventArgs>(serviceClient_GetFilteredMessageCompleted);
and then sends a asynchronous message to the server to get required data from database. at the same time, the form adds another event listener and then sends another message:
GP.GlobalInfo.CommWCF.serviceClient.GetFilteredMessageCompleted += new EventHandler<GetFilteredMessageCompletedEventArgs>(serviceClient_GetFilteredMessageCompletedAnother);
so the client (form) is waiting for two messages to be returned. as soon as messages are returned the form will display the data in a grid.
It seems not working as I expect. somehow messages get stuck somewhere. so, I would like to know if my approach is wrong.
Another case is, there are five objects on the screen that I can click. These five objects will use the same Class to create. clicking an object brings a form with corresponding data. if I click the first object, the form will add an event listener and sends a message to the server. while the form is waiting for the data, I close the form, and then open another form by clicking another object. The new form will add an event listener and sends a new message to the server.
Meantime, the server has been working the first form message, and returns the result to the second form.. not the first one(this has been closed).
this is what I experience right now. can anybody give me some solution ASAP for the better behavior and understanding of silverlight and WCF. I think I should send a stop message to the server or something..
-------old question----------
Hi I seem to have some problem with communicating between client and server .
when a form is opened, there are three listeners are opened. Each listener gets the required data.
I think (not sure) silverlight gets stuck while it communicates using those three listeners at the same time.
So, should I use only one listener running at the same time always in silverlight? so like,
client asking A data from server
client asking B data from server
client save C data to server
those stuffs cannot be done at the same time ? Do I always make sure of single communication process between client and server?
Thanks