Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the unstable socket connection error #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ababycat
Copy link

@ababycat ababycat commented Apr 23, 2023

If notify_one() of the condition variable has been called before the function wait(), wait() blocks the connection until the next connection is established.

So you get an socket connect Error. #102 etc. It will occur more frequently on the iOS platform.

solution:
Use FScopedEvent of UE to synchronize the finished status.

reference:

https://en.cppreference.com/w/cpp/thread/condition_variable/notify_one
https://docs.unrealengine.com/4.26/en-US/API/Runtime/Core/Misc/FScopedEvent/

If notify_one() of the condition variable has been called before the function wait(), wait()  blocks the connection until the next connection is established. 

So you get an socket connect Error.  It will occur more frequently on the iOS platform.

solution:
Use FScopedEvent of UE.

reference: 
https://en.cppreference.com/w/cpp/thread/condition_variable/notify_one
https://docs.unrealengine.com/4.26/en-US/API/Runtime/Core/Misc/FScopedEvent/
@tencent-adm
Copy link
Member

tencent-adm commented Apr 23, 2023

CLA assistant check
All committers have signed the CLA.

@ababycat ababycat changed the title fix the unstable socket connection error fix the unstable socket connection error #102 Apr 23, 2023
@ababycat ababycat changed the title fix the unstable socket connection error #102 fix the unstable socket connection error Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants