I have a WCF service(hosted in a WPF application) that handles the communication between clients(WPF). There's a scenario, where one client sends a message to the servuce, who broadcasts it to the other clients but the message results in the other client sending a new message back and they all freeze. After some reading I suspect that the second client tries to make a call to the service while the service's call still hasn't finished (using the same channel). However, I'm not sure is my assumption correct and if so how to overcome it.
In a bit more detail: the clients are text editors. If you write in one, operations that represent the changes are sent to the service and from there to the other clients. When I try to send operations about the others' caret movements though, it freezes. I assume it's because the InsertOperation that the second client receives causes a caret movement and it tries to send a CaretMoveOperation back in the event handler making a call using the same channel the service uses for sending the message, causing a deadlock.
What do you think? Can you suggest something?
I would check two things
You have to look at your service behavior attribute. When things look like only one message is processed at a time (it probably means single threaded).
An excerpt from MSDN
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.