A
Angus
Hello
I have written my own C++ class to handle winsock. It uses an asynchronous
programming model so basically you ask for something and then when network
has info it gets sent to my class and I can deal with it. Basically, a user
class derives from this networking class and overrides functions such as
OnCompleteMessage.
Sometimes, however, it is more convenient for the user class if it can call
a function which then provides the response on returning. Should I provide
synchronous functions in my class? Or is this bad design? Instead should
user class just work in same asynchronous manner? Or is there a good way to
deal with this sync function requirement some other way?
I know all this sounds vague but I am really looking for general design
guidance. I am happy to provide more details on the class or the class
itself if that would be useful.
Angus
I have written my own C++ class to handle winsock. It uses an asynchronous
programming model so basically you ask for something and then when network
has info it gets sent to my class and I can deal with it. Basically, a user
class derives from this networking class and overrides functions such as
OnCompleteMessage.
Sometimes, however, it is more convenient for the user class if it can call
a function which then provides the response on returning. Should I provide
synchronous functions in my class? Or is this bad design? Instead should
user class just work in same asynchronous manner? Or is there a good way to
deal with this sync function requirement some other way?
I know all this sounds vague but I am really looking for general design
guidance. I am happy to provide more details on the class or the class
itself if that would be useful.
Angus