-
Notifications
You must be signed in to change notification settings - Fork 70
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
Test if internet listener socket creation succeeded? #474
Comments
How about Soar/Core/ClientSML/src/sml_ClientKernel.cpp Line 150 in bdf5f02
|
Sadly no good. It returns False for me whether the internet socket failed or not. In more detail, the following code:
Yields the following output if I already have a debugger open that's claimed port 12121:
|
Thanks, I see what you mean now. The kernel is created successfully, meaning that the SML connection (which is just a communication API, not necessarily involving a network) is created successfully, as well. You have to dive pretty far into the call to I was going to suggest, as a very last resort, that you try |
I had been hoping there was a way to test if a kernel was successful at creating a listener socket.
If one creates a kernel with a port that is already taken, socket creation will fail and print to the terminal a corresponding message.
I can't seem to find any way of detecting that failure using SML, however.
If I try to use kernel.HadError() or kernel.GetLastErrorDescription(), it shows as no error.
If I try to use kernel.GetAllConnectionInfo() and kernel.GetConnectionInfo(0) or kernel.GetConnection(), what I get back doesn't seem to be usable. (The functions I see in sml_ClientConnection.h don't seem to be available on the returned object, and the only functions my debugger shows as available for that object are cryptic and don't seem like they're meant to be used by an SML coder.)
And kernel.GetConnectionStatus(char const* pConnectionName) requires a connection name, and I see no indication where that might come from.
So maybe I'm just missing something. But if this info is not inspectable, it would be nice to make it inspectable.
The text was updated successfully, but these errors were encountered: