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

MinGW 7.3 Client Issue #268

Open
StefanGu65 opened this issue Apr 21, 2019 · 5 comments
Open

MinGW 7.3 Client Issue #268

StefanGu65 opened this issue Apr 21, 2019 · 5 comments

Comments

@StefanGu65
Copy link

Hello!

I've been using this package for a while on several platforms, mostly embedded Yocto Linux, but also on Windows for the client side (pre-compiled v 0.5).

I now need to create a Qt windows client that attaches to the Yocto-based server running the RPC server.

A raw mingw32 console app using the old windows package (as downloaded) does work, you can use the .a and dll for that package and it works (but ugly and difficult to maintain).

Now when using the master branch under Qt5's MinGW 7.3 (32 and 64 same issue), the compile process fails for the windows TCP connector:

`\libjson-rpc-cpp\src\jsonrpccpp\client\connectors\windowstcpsocketclient.cpp:32:6: error: declaration of 'virtual void jsonrpc::WindowsTcpSocketClient::SendRPCMessage(const string&, std::__cxx11::string&) throw (jsonrpc::JsonRpcException)' has a different exception specifier
void WindowsTcpSocketClient::SendRPCMessage(``

C++11 no longer accept these exception specifiers. And going back to c++98 obviously does not work either.

I tried a quick and dirty "fix" by removing the throw-declarations in the source, and it does indeed compile after this.

Problem being that the client simply hangs when it tries to call the server, the Call() never returns...
The server works just fine!

Do you have any idea that I could try?
I'll be happy to develop and push the windows fix, but I appreciate any hints that you can give me!

Alternatively, I could try and use the HTTP connector instead of TCP, but then I need to update the embedded servers as well to add support for windows libcurl. Also, building libcurl under windows is a bit of a bear, especially the SSL parts...

Many thanks,
Stefan

@StefanGu65
Copy link
Author

Additional info!

I used "Hercules" to debug the socket interface after fixing the c++11 "throw" problem in the windows socket client.
The issue is simply that the win client in "master" NEVER SENDS THE DELIMITER CHAR TO THE SERVER
That means that the read reply will never come back from the server... I was hoping for a timeout to kill the query, but that does not seem to implemented in the server (maybe a feature request?).

I will have to find the root cause, but for now I simply add that to the message to be sent at the lowest level. I'll run this for awhile and if ok, I'll prepare a patch that you can either pull or at least make available, "as is".

Again thanks for a great SW!

@cinemast
Copy link
Owner

You are absolutley right about the missing DELIMITER_CHAR. Windows support should never have been merged the way it currently is. Windows is currently not really supported on my end.

@StefanGu65
Copy link
Author

So, would you accept my changes into the master if I clean up the windows integration?
Also, would you have any preference for native windows vs. say, boost::asio?

@cinemast
Copy link
Owner

Yes, that would be great. Then we could also integrate appveyour to proper test the Windows integration. I'd prefer native windows stuff to keep the dependencies down.

@StefanGu65
Copy link
Author

Sounds good,
I have a working win version that I am testing. There are a few things I need to find and correct;

  • Root cause of the delimiter missing
  • Handle leak if the server does not respond (socket level cleanups needed)
  • Timeout if the server does not respond on application level within a reasonable time (I mean, it's an RPC that should return status immediately...) with the socket open

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

2 participants