Skip to content

In mg_connection, what does the field data[] do exactly? #2653

Discussion options

You must be logged in to vote

https://mongoose.ws/documentation/#struct-mg_connection

Arbitrary connection data

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.

c->data[0] = 'L'; // Mark that connection as live log listener

static void broadcast_message(

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by scaprile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants