Hello.

Is it possible for the client to send an event as data to the host?

My client simply subscribes to these tables, but only to some that are well screened with filters of type (row ) => (row.Field_A == 'Val1' || row.Field_B == 'Val2') . I tried to return this event as part of the DataContract class, but nothing happened, WCF doesn’t even serialize it. Is it somehow possible to do?

Thank.

  • one
    No, the event is not data. You will have to make the Subscribe method, after which the client will receive a callback call. (Perhaps, for this you need a duplex connection.) - VladD
  • Those. pass the table row back to the client so that he himself runs this event, I understand correctly? - nvse
  • @nvse: Do you have an event - is it an event ? If yes, then you know better what the handler needs on that side. - VladD
  • Well thank you. True, the data I have come with a very large frequency, and I do not feel like constantly pulling the client (1 time useful for 10 unnecessary). Therefore, probably, then it is better to transfer these filters as objects to the server immediately. But this, of course, will not be as convenient as through events, okay. - nvse
  • Look, maybe here codeproject.com/Articles/596287/… what's useful for you. - aleksandr_mai

1 answer 1

As I understand it, the client needs to obtain the necessary data as soon as they arrive at the server, without overloading themselves with requests? But there are not only asynchronous requests from the client, but also asynchronous server responses, that is, the server will respond to the request only when the necessary data is received in the database! Maybe this will help?