The FlexSim block when i call a remote server interface by dll functon

The FlexSim block when i call a remote server interface by dll functon

yexioamu
Not applicable
10 Views
3 Replies
Message 1 of 4

The FlexSim block when i call a remote server interface by dll functon

yexioamu
Not applicable

[ FlexSim 21.2.4 ]

I create a dll function that implement the winHTTP, because my flexsim is 21.2.4 which can't modify the HTTP headers.

When I call a remote server interface by this dll, it can work, but the flexsim will block a few seconds,then recieve the response from the remote server. I search this question in this forum, i read this one( Is FlexSim thread safe?), but i can't run this module.

Could i run a separate thread to prevent the flexsim block?

0 Likes
Accepted solutions (1)
11 Views
3 Replies
Replies (3)
Message 2 of 4

JordanLJohnson
Autodesk
Autodesk
Accepted solution

The approach shown in the question you linked to is the right approach. You can launch a thread, and then from that thread, use PostMessage to call a function on the main thread.

.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 3 of 4

philboboADSK
Autodesk
Autodesk

WinHTTP also has an asynchronous mode configured with a flag (WINHTTP_FLAG_ASYNC - WinHttpOpen function) and callback (WinHttpSetStatusCallback function).



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 4 of 4

julie_weller
Not applicable

Hi @yexioamu, was Jordan Johnson's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes