Reputation:
Hello, I am a newbie of websocket programming.
I have read and try the javascript websocket send(), it send a message to websocket server.
Can I call the server and get return value from server? or I must use the WAMP sub-protocol?
Upvotes: 0
Views: 3663
Reputation: 22051
WebSocket is low-level, point-to-point messaging. There is no such thing as "call a procedure on a server and get a result".
If you want to have such "remote procedure calling" (RPC), you need to layer something on top of WebSocket. WAMP provides that in an open standard protocol.
Of course you could also reinvent the wheel and implement your own RPC. But then you cannot reuse WAMP implementations like Rachet (currently WAMP v1 only) or Thruway (WAMP v2).
Upvotes: 1