Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By RichardS
#85542 Here is what its doing, its calling a standard printf function that was referred to in the client referenced by the ID

I am assuming that is there so you can override and define your own printf for that client ID?

Code: Select allsize_t AsyncWebSocket::printf(uint32_t id, const char *format, ...){
  AsyncWebSocketClient * c = client(id);
  if(c){
    va_list arg;
    va_start(arg, format);
    size_t len = c->printf(format, arg);
    va_end(arg);
    return len;
  }
  return 0;
}
User avatar
By sfranzyshen
#85543
RichardS wrote:Here is what its doing, its calling a standard printf function that was referred to in the client referenced by the ID

I am assuming that is there so you can override and define your own printf for that client ID?

Code: Select allsize_t AsyncWebSocket::printf(uint32_t id, const char *format, ...){
  AsyncWebSocketClient * c = client(id);
  if(c){
    va_list arg;
    va_start(arg, format);
    size_t len = c->printf(format, arg);
    va_end(arg);
    return len;
  }
  return 0;
}


Thank You for your response ... I was starting to think that only bots read my messages here ... you dug further into the code than I did ... got lost with the macros ... I think that this problem has been "can kicked" for a long time ... and now ... I too have changed direction and have eliminated my need for the ws.printf() function ... so now this too is the end of my ranting about the problem. It would be nice to once and all fix this ... but since it's not a issue to the developer (and now not an issue to me) I guess it'll linger on and on ... I just hope that someone else trying this out can find these post and avoid hours of aggravation ... TY again for you responce ~peace
User avatar
By RichardS
#85544 OK some more....

try:

ws.text(id, "hey!", 4);

does this work??

or

ws.client(id).text("hey!", 4);

is more like what printf is doing...
User avatar
By RichardS
#85545 just thinking you might need to do

ws.client(id)->text("hey!", 4);

instead of

ws.client(id).text("hey!", 4);

can not remember if it was a pointer to the client or not...