In mg_connection, what does the field data[] do exactly? #2653
-
In the pushing-live-data-on-http-connections (https://mongoose.ws/documentation/tutorials/webui-push/#pushing-live-data-on-http-connections), we have this chunk of code :
I am trying to find what the c->data[] is exactly. In the source code, it says this :
So it doesn't explain what data[] is in mg_connection and why putting c->data[0] = 'L' is used. Is that explained somewhere? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
https://mongoose.ws/documentation/#struct-mg_connection
Definitions from Oxford Languages: Just a bunch of data so the user is able to put there whatever is needed. Can be used to mark connections in order to recognize specific ones when scanning through all. Can be used for whatever the user feels something can be stored in there. mongoose/examples/live-log/main.c Line 17 in d7b2b3f mongoose/examples/live-log/main.c Lines 34 to 39 in d7b2b3f |
Beta Was this translation helpful? Give feedback.
https://mongoose.ws/documentation/#struct-mg_connection
Definitions from Oxford Languages:
1. based on random choice or personal whim, rather than any reason or system. "an arbitrary decision"
Just a bunch of data so the user is able to put there whatever is needed. Can be used to mark connections in order to recognize specific ones when scanning through all. Can be used for whatever the user feels something can be stored in there.
mongoose/examples/live-log/main.c
Line 17 in d7b2b3f
mongoose/examples/live-log/main.c
Lines 34 to 39 in d7b2b3f