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

Example chat error #66

Closed
StefanSlev opened this issue Apr 29, 2019 · 8 comments
Closed

Example chat error #66

StefanSlev opened this issue Apr 29, 2019 · 8 comments

Comments

@StefanSlev
Copy link

I followed all the steps in building section and then I wanted to start the chat example. I had to copy "GameNetworkingSockets.dll" and "libprotobuf.dll" next to the binary "example_chat" to make it run. I started my server with "example_chat server --port 9090" and the client with "example_chat client 0.0.0.0:9090". The server starts and logs the fact that is listening for incoming clients but the client fails with " 1.001678 \src\steamnetworkingsockets\clientlib\steamnetworkingsockets_lowlevel.cpp (875) : Assertion Failed: SDR service thread gave up on lock after waiting 1000ms. This directly adds to delay of processing of network packets!"

I am not sure what I am doing wrong. Hope you already encountered this problem :)
Also, can you explain briefly how do I link a new project with this library ?

P.S. I am working on windows and I used Visual Studio to build everything

@zpostfacto
Copy link
Contributor

0.0.0.0 is not the right address to connect to your server. 0.0.0.0 means "any local IP" and it's a valid thing to use when listening, but not when connecting

127.0.0.1 is the right IP to connect.

I'll see what is causing that assert, but I suspect it is downstrram of that.

@StefanSlev
Copy link
Author

I tried to connect to my server with 127.0.0.1 but the error still pops up.

@zpostfacto
Copy link
Contributor

zpostfacto commented May 3, 2019

Nope, I haven't seen that one! I'll see if I can reproduce it. Is this a debug build or a release build?

Just had an idea. Is the Windows firewall prompt coming up and stalling any of the socket calls?

Also, can you explain briefly how do I link a new project with this library ?

Ah, ordinary (non-CMake) Visual Studio projects. That's something I know about! (I really don't know anything about CMake). For that, you would just link with the import library GameNetworkingSockets.lib and have the .dll nearby your executable when it runs.

@StefanSlev
Copy link
Author

I got the error mentioned when I tried to run the example_chat.exe, the one created after building the project as explained in BUILDING.md.

After that, I tried to build the example on my own in a VS project. On debug as well as on release, the client crashes on line 529: m_hConnection = m_pInterface->ConnectByIPAddress(serverAddr); with Access violation reading location; It seems that m_pInterface is a null pointer.

@ClementCapart
Copy link

Crash when trying to connect as client (server seems to run fine).

 	GameNetworkingSockets.dll!std::char_traits<char>::assign(char & _Left, const char & _Right) Line 343	C++
 	GameNetworkingSockets.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Eos(const unsigned __int64 _Newsize) Line 3857	C++
 	GameNetworkingSockets.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::clear() Line 2881	C++
 	GameNetworkingSockets.dll!CCryptoKeyBase::GetRawDataAsStdString(std::basic_string<char,std::char_traits<char>,std::allocator<char> > * pString) Line 286	C++
 	GameNetworkingSockets.dll!SteamNetworkingSocketsLib::CSteamNetworkConnectionBase::InitLocalCryptoWithUnsignedCert() Line 692	C++
 	GameNetworkingSockets.dll!SteamNetworkingSocketsLib::CSteamNetworkConnectionBase::BThinkCryptoReady(__int64 usecNow) Line 604	C++
 	GameNetworkingSockets.dll!SteamNetworkingSocketsLib::CSteamNetworkConnectionBase::InitConnectionCrypto(__int64 usecNow) Line 556	C++
 	GameNetworkingSockets.dll!SteamNetworkingSocketsLib::CSteamNetworkConnectionBase::BInitConnection(__int64 usecNow, char[1024] & errMsg) Line 529	C++
 	GameNetworkingSockets.dll!SteamNetworkingSocketsLib::CSteamNetworkConnectionUDP::BInitConnect(const SteamNetworkingIPAddr & addressRemote, char[1024] & errMsg) Line 775	C++
 	GameNetworkingSockets.dll!SteamNetworkingSocketsLib::CSteamNetworkingSockets::ConnectByIPAddress(const SteamNetworkingIPAddr & address) Line 444	C++
 	example_chat.exe!ChatClient::Run(const SteamNetworkingIPAddr & serverAddr) Line 535	C++
 	example_chat.exe!main(int argc, const char * * argv) Line 734	C++

Project built on Windows 10, with CMake/VS 2019. it seems to crash on calling std::string::clear(). when trying to obtain a crypto key.

@DerGaijin
Copy link

Same Error
any Updates about this Error how to fix it?

@TheWillard
Copy link

I had the same error, it occurred because I mixed debug and release builds (my OpenSSL & protobuf were release builds, while my GameNetworkingSockets build was a debug build), so make sure you are building all your dependencies and GameNetworkingSockets with the same build type. I guess it's the same with #54.

@DerGaijin
Copy link

Nice yes that worked for me
Thank you very much :D

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

No branches or pull requests

5 participants