c# - How to know when a response has finished being sent to the client? -


i have web api web method returns list of events in xml:

public ilist<event> getallevents() { ... }  public class event {     public string name { get; set; }      public int id { get; set; } } 

the client may send request , receive 100 events serialized happens that:

  • request received getallevents methods
  • data provided method
  • web api engine serializes object xml
  • web api engine sends serialized data (it might e.g. 5mb) client

the whole process may take e.g. 5 seconds.

i'd able log time when web api engine finishes sending serialized data client.

how achieve this?

what trying achieve here?

based on return type of action, web api creates content called objectcontent uses formatters serialize response.

for objectcontents, default, web api hosting layers 'buffer' entire response before starts sending buffered data on wire.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -