how to use uWebSockets push data to client actively?

616 views Asked by At

uWebsockets c++

h.onMessage([](WebSocket<SERVER> *ws, char *message, size_t length, OpCode opCode) {
   printf("$");

   char msg[1024] = "113.25|27.25|25.2";
   message = msg;
   length = strlen(msg);


   ws->send(message, length, opCode);

   //Sleep(1000);


 });

I want to send data from the server to the client actively. How should I do?

0

There are 0 answers