Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ebshimizu/socket.io-clientpp
A websocket++ and rapidjson based C++ Socket.IO client
https://github.com/ebshimizu/socket.io-clientpp
Last synced: 17 days ago
JSON representation
A websocket++ and rapidjson based C++ Socket.IO client
- Host: GitHub
- URL: https://github.com/ebshimizu/socket.io-clientpp
- Owner: ebshimizu
- License: other
- Created: 2012-08-24T15:21:16.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-04-17T18:35:19.000Z (over 9 years ago)
- Last Synced: 2024-07-31T22:53:21.811Z (3 months ago)
- Language: C++
- Size: 791 KB
- Stars: 111
- Watchers: 19
- Forks: 46
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# Socket.IO Client++
A [websocket++](https://github.com/zaphoyd/websocketpp) and [rapidjson](https://github.com/miloyip/rapidjson) based C++ client for [Socket.IO](https://github.com/LearnBoost/socket.io).
This library is able to connect to a Socket.IO server, and then send and receive messages.This project has not been tested with anything after Socket.IO 0.8.
## Usage
1. Make sure you have the boost libararies installed.
2. Include websocket++, rapidjson and `socket_io_client.cpp` in your project.
3. Include `socket_io_client.hpp` where you want to use it.### Example Code
The minimal amount of code needed to make a connection to a Socket.IO server is as follows:socketio_client_handler_ptr handler(new socketio_client_handler());
client endpoint(handler);
client::connection_ptr con = endpoint.get_connection(handler->perform_handshake("ws://localhost:8080"));
For examples of event binding and additional settings, see the sample code in the msvc folder.### Namespaces and Endpoints
To connect to a namespace, after doing the handshake and when the handler is ready, call `connect_endpoint("\endpointName")`. See the example for more details.
## Notes
This client isn't a full port of the Socket.IO client at this point. It doesn't handle reconnection events, fire off default events, maintain any status indicators, or do things as elegantly as the javascript client. If you'd like to help make this a full implementation of the Socket.IO client, fork away!Socket.io-client++-specific source is released under the BSD license.