Connect C++ to PHP React WsServer / WampServer

#1

I have an existing PHP server (which I didn’t write) running WebSockets and a WampServer. Works for PHP and ajax connections.

I am trying to use the C++ Autobahn implementation and I can’t get the client to connect. Doesn’t matter if I use the samples that came with the source or my own implementation. it just hangs (waits forever) on (from subscriber.cpp):

connect_future = transport->connect().then([&](boost::future connected) {

As soon as I close the PHP server, I get a Boost error which isnt’ tied to one of the try/catch blocks:

rawsocket handshake error: asio.misc:2

If I try to connect without the PHP server running, I immediately exit from the

io.run();

call with no error messages.

Based on the error, I assume it is connecting but the PHP server isn’t sending back the expected response? Not really sure where to start here since the server is working for the non-C++ code.

TIA!

  • Brian
0 Likes

#2

Should have mentioned the PHP server is using React and Ratchet.

···

On Tuesday, June 5, 2018 at 7:32:06 AM UTC-5, Brian Pez wrote:

I have an existing PHP server (which I didn’t write) running WebSockets and a WampServer. Works for PHP and ajax connections.

I am trying to use the C++ Autobahn implementation and I can’t get the client to connect. Doesn’t matter if I use the samples that came with the source or my own implementation. it just hangs (waits forever) on (from subscriber.cpp):

connect_future = transport->connect().then([&](boost::future connected) {

As soon as I close the PHP server, I get a Boost error which isnt’ tied to one of the try/catch blocks:

rawsocket handshake error: asio.misc:2

If I try to connect without the PHP server running, I immediately exit from the

io.run();

call with no error messages.

Based on the error, I assume it is connecting but the PHP server isn’t sending back the expected response? Not really sure where to start here since the server is working for the non-C++ code.

TIA!

  • Brian
0 Likes

#3

Can you get (say) the python example to connect to the router and register an RPC and have another python example call the RPC?
Can you do the same with c++ (this would be with a different domain, though you can still use your existing router).

Let me know if those work.

···

On Jun 5, 2018, at 22:36, Brian Pez br...@techstrength.com wrote:

Should have mentioned the PHP server is using React and Ratchet.

On Tuesday, June 5, 2018 at 7:32:06 AM UTC-5, Brian Pez wrote:

I have an existing PHP server (which I didn’t write) running WebSockets and a WampServer. Works for PHP and ajax connections.

I am trying to use the C++ Autobahn implementation and I can’t get the client to connect. Doesn’t matter if I use the samples that came with the source or my own implementation. it just hangs (waits forever) on (from subscriber.cpp):

connect_future = transport->connect().then([&](boost::future connected) {

As soon as I close the PHP server, I get a Boost error which isnt’ tied to one of the try/catch blocks:

rawsocket handshake error: asio.misc:2

If I try to connect without the PHP server running, I immediately exit from the

io.run();

call with no error messages.

Based on the error, I assume it is connecting but the PHP server isn’t sending back the expected response? Not really sure where to start here since the server is working for the non-C++ code.

TIA!

  • Brian


You received this message because you are subscribed to the Google Groups “Autobahn” group.
To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+...@googlegroups.com.
To post to this group, send email to autob...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autobahnws/687f8009-507e-478b-a777-ddd9610563ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#4

I don’t know anything about python. I followed the directions in
autobahn-python/examples/running-the-examples.md

and ran the basic subscriber and got the following error:

python asyncio/wamp/pubsub/basic/frontend.py

File “asyncio/wamp/pubsub/basic/frontend.py”, line 38

async def onJoin(self, details):

^

SyntaxError: invalid syntax

This is on Fedora 28, Python 2.7.15

I guess I could hard code the server to intercept the messages and use ZeroMQ to send the data to the C program…

  • b
···

On Tue, Jun 5, 2018 at 8:39 AM, DV Henkel-Wallace gu...@henkel-wallace.org wrote:

Can you get (say) the python example to connect to the router and register an RPC and have another python example call the RPC?
Can you do the same with c++ (this would be with a different domain, though you can still use your existing router).

Let me know if those work.

On Jun 5, 2018, at 22:36, Brian Pez br...@techstrength.com wrote:

Should have mentioned the PHP server is using React and Ratchet.

On Tuesday, June 5, 2018 at 7:32:06 AM UTC-5, Brian Pez wrote:

I have an existing PHP server (which I didn’t write) running WebSockets and a WampServer. Works for PHP and ajax connections.

I am trying to use the C++ Autobahn implementation and I can’t get the client to connect. Doesn’t matter if I use the samples that came with the source or my own implementation. it just hangs (waits forever) on (from subscriber.cpp):

connect_future = transport->connect().then([&](boost::future connected) {

As soon as I close the PHP server, I get a Boost error which isnt’ tied to one of the try/catch blocks:

rawsocket handshake error: asio.misc:2

If I try to connect without the PHP server running, I immediately exit from the

io.run();

call with no error messages.

Based on the error, I assume it is connecting but the PHP server isn’t sending back the expected response? Not really sure where to start here since the server is working for the non-C++ code.

TIA!

  • Brian


You received this message because you are subscribed to the Google Groups “Autobahn” group.
To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+unsubscribe@googlegroups.com.
To post to this group, send email to autob...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autobahnws/687f8009-507e-478b-a777-ddd9610563ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+unsubscribe@googlegroups.com.

To post to this group, send email to autob...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/autobahnws/0AEABB64-8275-484B-A969-2E94F2B2A15C%40henkel-wallace.org.

For more options, visit https://groups.google.com/d/optout.

0 Likes

#5

the WAMP_POCO fork has a javascript version which is reporting a ‘Error during Websocket handshake: Unexpected response code 426’. Looking in the console, at the network messages, I see

426: No Sec-WebSocket-Protocols requested supported

So, I assume there is an issue at the server…

  • B
···

On Tue, Jun 5, 2018 at 9:02 AM, Brian Peschel br...@techstrength.com wrote:

I don’t know anything about python. I followed the directions in
autobahn-python/examples/running-the-examples.md

and ran the basic subscriber and got the following error:

python asyncio/wamp/pubsub/basic/frontend.py

File “asyncio/wamp/pubsub/basic/frontend.py”, line 38

async def onJoin(self, details):

^

SyntaxError: invalid syntax

This is on Fedora 28, Python 2.7.15

I guess I could hard code the server to intercept the messages and use ZeroMQ to send the data to the C program…

  • b

On Tue, Jun 5, 2018 at 8:39 AM, DV Henkel-Wallace gu...@henkel-wallace.org wrote:

Can you get (say) the python example to connect to the router and register an RPC and have another python example call the RPC?
Can you do the same with c++ (this would be with a different domain, though you can still use your existing router).

Let me know if those work.

On Jun 5, 2018, at 22:36, Brian Pez br...@techstrength.com wrote:

Should have mentioned the PHP server is using React and Ratchet.

On Tuesday, June 5, 2018 at 7:32:06 AM UTC-5, Brian Pez wrote:

I have an existing PHP server (which I didn’t write) running WebSockets and a WampServer. Works for PHP and ajax connections.

I am trying to use the C++ Autobahn implementation and I can’t get the client to connect. Doesn’t matter if I use the samples that came with the source or my own implementation. it just hangs (waits forever) on (from subscriber.cpp):

connect_future = transport->connect().then([&](boost::future connected) {

As soon as I close the PHP server, I get a Boost error which isnt’ tied to one of the try/catch blocks:

rawsocket handshake error: asio.misc:2

If I try to connect without the PHP server running, I immediately exit from the

io.run();

call with no error messages.

Based on the error, I assume it is connecting but the PHP server isn’t sending back the expected response? Not really sure where to start here since the server is working for the non-C++ code.

TIA!

  • Brian


You received this message because you are subscribed to the Google Groups “Autobahn” group.
To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+unsubscribe@googlegroups.com.
To post to this group, send email to autob...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autobahnws/687f8009-507e-478b-a777-ddd9610563ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+unsubscribe@googlegroups.com.

To post to this group, send email to autob...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/autobahnws/0AEABB64-8275-484B-A969-2E94F2B2A15C%40henkel-wallace.org.

For more options, visit https://groups.google.com/d/optout.

0 Likes