Open kyo055 opened 7 years ago
@kyo055 . You have saved my time.thanks .Now my sockets connected successfully
websocket_client client; //start socket connection to server try {
std::cout << "started //";
client.connect(U("wss://sadfshafdghs.com/ws?account_id=4de3f308f2f8d3247a70w2228f94e0d2aea&ws_key=reception")).wait();
std::cout << "\n...........1st.........;";
}
catch (const std::exception&e)
{
std::cout << e.what() << std::endl;
}
//send messages to the server
//websocket_outgoing_message msg;
//msg.set_pong_message();
//std::cout << "\n...........2nd.........;";
//std::string data = "hii";
//client.send(msg).then([]() {
//
//
//
//
// /* Successfully sent the message. */ });
//std::cout << " Successfully sent the message.";
//std::cout << "\n...........3rd.........;";
//receive messages from the server
client.receive().then([](websocket_incoming_message msg) {
std::cout << "receiving data from socket";
return msg.extract_string();
}).then([](std::string body) {
std::cout << "displaying the data";
std::cout << body << std::endl;
});
//close the connection
//client.close().then([]() {
// std::cout << "successfully close socket connction";
// /* Successfully closed the connection. */
//});
data{"action":"refresh_dashboard","data":{"users_list":[{"user_id":"901e6076asff351cfc2195fb86f8438sa26","extensions":["1002"],"name":"sM"},{"user_id":"cc3f94ecc14ee9c55670dcde9adc1s887","extensions":["1006"],"name":"sS Kiran"},{"user_id":"6c29ebdb34asae1761fdf9423c573087979","extensions":["1003","+1732451as4180"],"name":"sNath"},{"user_id":"74d5bas5a9sasaca1faa4c2f217ce87b621d8","extensions":["1008"],"name":"sRaju"},{"user_id":"a7ad7e73bsasf93ea83c8efdc1723cba198","extensions":["1007"],"name":"sArif"},{"user_id":"b55146df5sas93ec8d09e5fe12a8a4c1108","extensions":["1001"],"name":"sdsds dsd"}]}}
@kyo055 How did you resolve that problem: "set_fail_handler: 7: End of File"? I met the same question.
I use the websocket to connect the server with the code as :
but always get the error with : set_fail_handler: 7: End of File
And when I try to use the Winsocket2, I can connect with the server.