-
Notifications
You must be signed in to change notification settings - Fork 104
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
Support MSVC/Windows #2
Comments
Hi I like the autobahn websocket very much and use the autobahn.js in a tiny project. But unfortunalety I need it in a MSVC project. First step, the examples need the In autobahn_impl.hpp #ifdef WIN32
#include <WinSock2.h>
#include <io.h>
#else
#include <arpa/inet.h>
#include <unistd.h>
#endif will help. But now i stuck on this: Maybe someone can help out. Greets |
@solarisx What environment are you using? Compiler version, Boost version, etc |
Visual C++ 2013 with 18.00.30723 Compiler on Win7 x64. |
I am having the exact same error with the same setup as solarisx. |
@DominickT sorry, I don't use Windows/VC++ nowerdays and won't have time to do so soon. You might have a look at and/or ask on Boost mailing lists. Probabyl |
I managed to port it to Visual C++ 2012 (vc110) and boost 1.56.0. I did not try Visual C++ 2013 (vc120). It wasn't that bad - mostly took some configuration (boost defines) and converting As I only need it for a prototype for now, I haven't run tests but the basics seem to work: binding rpc methods, calling them via html+js through a crossbar instance. I don't plan to maintain this port - but may be able to make it available on request. |
After a big battle, I managed to get it to compile and run (Windows 7 / VS 2013 / VC120). Apart from following the advice above, a patch was needed inside Boost future.hpp: If the above change is not made, autobahn_impl.hpp doesn't compile due to this operation: Unfortunately running it doesn't produce the expected results. The socket connection succeeds but the client never enters the specified realm. This is the whole output with debug mode enabled, when running the call1.cpp example: Running on 105700 ...and the client remains stuck at this point. Any advice on how to proceed? |
See my comment at #27 |
@IvaKom , thanks for the tip! Anyhow, more importantly, my C++ client never joins the realm ("realm1" in my case). session_future = session.join("realm1").then([&](shared_future<uint64_t> s) { OTOH, the nodejs and browser based clients successfully manage to connect and perform RPC calls, etc. I have followed the other advice on this thread:
Still, the C++ client never enters the specified realm. What am I still missing? Thanks in advance! |
I'll try to come up with a clean PR.
|
I've created a pull request, see #28. |
Thanks! After you compile and run it, are you able to join the realm of a crossbar server? I have tried with an instance running over the network, as well as against demo.crossbar.io, but to no avail. |
Exactly. That is the most profound issue - not being able to join the
|
FWIW, AutobahnCpp does not take a WebSocket URL, since it currently does not support WebSocket as a WAMP transport, but only RawSocket. The latter only needs IP and port. |
Alright, but in that case, if the whole URL is ws://192.168.1.1:8080/ws, |
No. There is no path with RawSocket. |
So the bottom line is that with AutobahnCpp, the only supported Crossbar URLs are of the form ws://192.168.1.1:8080 , i.e. nothing else could be in the path? |
@krasi0 I got it working by starting the crossbar server using a raw socket instead of websocket. For the example to run, I fixed the file from crossbar.router.router import RouterFactory
from crossbar.router.router import RouterSessionFactory Also i needed to install the package |
This sounds like a plan, but in that case are the nodejs and Web browser On Sun, Feb 22, 2015 at 7:34 PM, mananatee [email protected] wrote:
BR |
@krasi0 Yes. If you use Crossbar.io. |
@oberstet Ok thanks for heads up. I just made the modification since this is the example script supplied with Autobahn.Python and it is now broken (the classes that are used seem to have moved from autobahn to crossbar). I'm sure the same can be achieved by just setting the right configuration in the .crossbar file. |
@mananatee yes, see http://crossbar.io/docs/Getting-started-with-Cplusplus/ |
@oberstet that "Getting started" tutorial definitely answers many of the questions. |
@krasimir-littlepostman great to hear you've got it working! ah, and sorry for costing you time with this - we clearly should update the docs on AutobahnCpp to mention all this. And yes: today, WebSocket and RawSocket transports for WAMP have to run on different ports. There is a slight revision of WAMP-over-RawSocket in the spec that will lift that and allows to run both transports on one port. Not implement yet in any library though ... |
Another tip to the poor souls like me, who have to use VS: struct call_t {
In autobahn_impl.hpp, every Thanks to @IvaKom suggestion. |
Add public headers as dependencies to examples so they show up in IDEs.
There hasn't been activity in this issue for a year now ... can anyone give a quick status update how to run autobahn with MSVC (is possible)? Thanks! |
As MSVC apparently IS supported nowadays, I guess this ticket can be closed? |
Update: While compilation with VS 2015 works now, VS 2013 raises errors on private member access in
|
@supermihi this PR #103 was recently merged, where @DZabavchik has added a number of fixes which apparently make VS 2015 work. So yes, closing this one. I have no clue about the VS 2013 thing, so .. |
Yes, I can confirm that 2015 works. I might open another ticket for VS2013 (though I'll probably switch to C#/WampSharp anyway ...) |
@supermihi FWIW, we won't spend much effort on working around VS2013 limitations rgd modern C++ support, which likely is the reason (as both GCC, Clang and VS2015 work now). The "fix" is: upgrade VS;) This is by policy: AutobahnCpp requires a modern C++ compiler, due to the use of advanced C++ features, and there is no point in trying to retrofit old compilers.
I am not doing Windows these days anymore, so I on longer track developments there, but I am wondering about https://en.wikipedia.org/wiki/C%2B%2B/CX - MS seems to invent new C++ flavors every now and then;) What's C++/CX or what do use it for? Does it work with Boost, ASIO and Autobahn? |
@oberstet Thanks for the clarification. I fully understand your reluctance to care about MS' specific interpretation of C++. My original motivation to use VS2013 was that another library I had to use did not run with 2015, however we'll be able to either workaround that or (as I mentioned above) switch to C# in the first place. In my understanding WinRT is something like .NET but unmanaged. The point is that you can use a WinRT class from other languages like C# and JavaScript directly. I haven't used this so far, but I'm pretty sure that you can use any "normal" C++ library within a C++/CX project... |
No description provided.
The text was updated successfully, but these errors were encountered: