Hi All,
I am developing a dll which will be exposing some API's like Login,Logout. This dll will be talking to another component(Say Engine) over the socket in the form of XML Request and Response messages.
e.g. Suppose Dll sent the Request like LoginRequest then that another component will respond with LoginResponse and some more message like LoginStatusEvent etc..
Also this component keeps on sending different messages which are not related to LoginRequest
So I am looking for implementation where dll will send the Request and will wait with the help of QWaitCondition.wait() maximum for let's say 15 sec and before this timeout if LoginResponse & LoginStatusEvent received from the socket then it will raise QWaitCondition::wakeup() so that it will wakeup and process the messages.
This dll will be consumed by any application which will invoke the API's and to avoid second time invocation and to respond with proper success or failure of the request I want to keep this as a blocking call.
Currently in my dll i do not have any thread and Socket Communication is happening using QTCPSocket.
I can not create the socket in QThread::Run() because all the request's are come from GUI API call.
So please guide how i can implement this.
Thanks in advance.
Bookmarks