c# - Events and threads in a socket based program -


i'm working on library .net messenger service.

it has connection main notification server, , connection per instant messaging session. handled using begin/end asynchronous methods.

at present, events library user (ie.. messagereceieved) called inside read callback thread (albeit traversing through few different layers.. message parsing , not).

this fine, means library user has careful. instance, blocking operation inside 1 of event handlers stop data being received.

is acceptable/the standard way things? raise events on threadpool thread if necessary.

eventually decided acceptable. you'll see same sort of problem windows forms. example, if perform blocking operation in clicked event handler, whole form locks up.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -