File tree Expand file tree Collapse file tree 2 files changed +15
-22
lines changed Expand file tree Collapse file tree 2 files changed +15
-22
lines changed Original file line number Diff line number Diff line change 27
27
28
28
...
29
29
30
- line_sender_error* err = NULL ;
31
- line_sender_opts* opts = NULL ;
32
- line_sender* sender = NULL ;
33
-
34
- line_sender_utf8 host = QDB_UTF8_LITERAL(" localhost" );
35
- opts = line_sender_opts_new(host, 9009 , &err);
36
- if (!opts) {
37
- /* ... handle error ... */
38
- }
30
+ line_sender_utf8 conf = QDB_UTF8_LITERAL(
31
+ " http::addr=localhost:9000;" );
39
32
40
- sender = line_sender_build(opts, &err);
41
- line_sender_opts_free (opts);
42
- opts = NULL;
33
+ line_sender_error* err = NULL ;
34
+ line_sender* sender = sender = line_sender_from_conf(&err);
43
35
if (!sender) {
44
36
/* ... handle error ... */
45
37
}
46
38
47
39
```
48
40
49
- The `opts` object can additionally take parameters for the outbound interface,
50
- authentication, full-connection encryption via TLS and more.
41
+ See the main [ client libraries] ( https://questdb.io/docs/reference/clients/overview/ )
42
+ documentation for the full config string params, including authentication, tls, etc.
43
+
44
+ You can also connect programmatically using ` line_sender_opts_new_tcp ` or
45
+ ` line_sender_opts_new_http ` .
51
46
52
47
### Building Messages
53
48
Original file line number Diff line number Diff line change 27
27
28
28
...
29
29
30
- // Automatically connects on object construction.
31
- questdb::ingress::line_sender sender{
32
- "localhost", // QuestDB hostname
33
- 9009}; // QuestDB port
30
+ auto sender = questdb::ingress::line_sender::from_conf(
31
+ " http::addr=localhost:1;" );
34
32
35
33
```
36
34
37
- For more advanced use cases, such as those requiring authentication or
38
- full-connection encryption via TLS, first, create an `opts` object then call its
39
- methods to populate its options and then pass the `opts` object to the
40
- `line_sender` constructor .
35
+ See the main [ client libraries ] ( https://questdb.io/docs/reference/clients/overview/ )
36
+ documentation for the full config string params, including authentication, tls, etc.
37
+
38
+ You can also connect programmatically using the ` questdb::ingress::opts ` object .
41
39
42
40
### Building Messages
43
41
You can’t perform that action at this time.
0 commit comments