1MONGOC_CLIENT_SET_APPNAME(3) libmongoc MONGOC_CLIENT_SET_APPNAME(3)
2
3
4
6 mongoc_client_set_appname - mongoc_client_set_appname()
7
9 bool
10 mongoc_client_set_appname (mongoc_client_t *client, const char *appname)
11
12 Sets the application name for this client. This string, along with
13 other internal driver details, is sent to the server as part of the
14 initial connection handshake ("hello").
15
16 appname is copied, and doesn't have to remain valid after the call to
17 mongoc_client_set_appname().
18
19 This function will log an error and return false in the following
20 cases:
21
22 • appname is longer than MONGOC_HANDSHAKE_APPNAME_MAX
23
24 • client has already initiated a handshake
25
26 • client is from a mongoc_client_pool_t
27
29 • client: A mongoc_client_t.
30
31 • appname: The application name, of length at most MONGOC_HAND‐
32 SHAKE_APPNAME_MAX.
33
35 true if the appname is set successfully. Otherwise, false.
36
38 MongoDB, Inc
39
41 2017-present, MongoDB, Inc
42
43
44
45
461.24.3 Aug 17, 2023 MONGOC_CLIENT_SET_APPNAME(3)