You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use the `int khpu(host, port,username)` function to connect to a q server.
514
+
We use the [`int khpu(host, port,username)`](capiref.md#khpu-connect-no-timeout) function to connect to a q server.
515
515
Note you _must_ call `khpu` before generating any q data, and the very first call to `khpu` must not be concurrent to other `khpu` calls.
516
516
To initialize memory without making a connection, use `khp("",-1);`
517
517
@@ -536,7 +536,7 @@ Return values for `khp`/`khpu`/`khpun` are:
536
536
537
537
Note that with the release of `c.o` with V2.6, `c.o` now tracks the connection type (pre-V2.6, or V2.6+). Hence to close the connection you must call [`kclose`](capiref.md#kclose-disconnect) (instead of `close` or `closeSocket`) – this will clean up the connection tracking and close the socket.
538
538
539
-
The `k` function is used to send messages over the connection. If a positive handle is used then the call is synchronous, otherwise it is an asynchronous call.
539
+
The [`k`](capiref.md#k-evaluate) function is used to send messages over the connection. If a positive handle is used then the call is synchronous, otherwise it is an asynchronous call.
540
540
541
541
```c
542
542
// Connect to a q server on the localhost port 1234.
@@ -577,7 +577,11 @@ There’s an additional return value for TLS connections, `-3`, which indicates
577
577
578
578
```c
579
579
extern K sslInfo(K x); // returns an error if init fails, or a dict of settings similar to -26!x
Prior to 4.1t 2023.11.10, SSL/TLS connections can be used from the initialization thread only, i.e. the thread which first calls any `khp` function since the start of the application. It can now be used for one-shot synchronous requests.
@@ -618,7 +622,6 @@ if(c>0) sst(c,30000,45000); // timeout sends with 30s, receives with 45s
618
622
```
619
623
620
624
621
-
622
625
## Bulk transfers
623
626
624
627
A kdb+tick feed handler can send one record at a time, like this
@@ -715,7 +718,7 @@ sd0(d);
715
718
sd0x(d,1);
716
719
```
717
720
718
-
Each of the above calls removes the callback on `d` and calls `kclose(d)`. `sd0x(I d,I f)` was introduced in V3.0 2013.04.04: its second argument indicates whether to call `kclose(d)`.
721
+
Each of the above calls removes the callback on `d` and calls `kclose(d)`. [`sd0x(I d,I f)`](capiref.md#sd0x-remove-callback-conditional) was introduced in V3.0 2013.04.04: its second argument indicates whether to call `kclose(d)`.
719
722
720
723
On Linux, `eventfd` can be used with `sd1` and `sd0`. Given a file efd.c
721
724
@@ -797,22 +800,35 @@ q).[{x+y};(1 2;3 4)]
797
800
4 6
798
801
```
799
802
800
-
The dynamic link, `K dl(V* f, I n)`, function takes a C function that would take _n_ K objects as arguments and return a new K object, and returns a q function.
803
+
The dynamic link, [`K dl(V* f, I n)`](capiref.md#dl-dynamic-link), function takes a C function that would take _n_ K objects as arguments and return a new K object, and returns a q function.
801
804
It is useful, for example, to expose more than one function from an extension module.
0 commit comments