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

OnNegociateResponse never called #11

Closed
julegault opened this issue Jul 20, 2022 · 2 comments
Closed

OnNegociateResponse never called #11

julegault opened this issue Jul 20, 2022 · 2 comments

Comments

@julegault
Copy link

Unreal 4.27.2

This is related to issue #10 and issue #6 because they both mention the same problem : OnNegociateResponse is never called in the provided code. refer to issue #6 for screenshots. I've been able to reproduce both issues. #10 happens with https connexion while #6 is easier to reproduce with http connexions

using a shared pointer with bindSP in connexion.cpp doesn't work, as the delegate is apparently never called. I tried changing it to bindRaw and it works, but the object the delegate is called on is a different one that has no populated attributes, so it ends up crashing too.

I don't know how to proceed to fix this, other than maybe change the way the negociation step happens. either by using a raw pointer or a lambda ?

@intelligide
Copy link
Contributor

intelligide commented Jul 26, 2022

I added a new troubleshoot section in the readme. Concretely, the problem comes from the fact that the functions are asynchronous and that the shared pointer removes the connection object and thus the connection with the server before the negotiation ended.
You just need to persist a reference to the connection object somewhere in your code.

@julegault
Copy link
Author

It makes perfect sense, but i would not have figured that out with my beginner level in unreal engine. many thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants