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
If only one synchronous query/request is to be run, then the one-shot synchronous request can be used to connect, send the query, get the results, then disconnect.
174
139
@@ -188,6 +153,41 @@ One-shot sync queries can now execute via `` `::[(":host:port";timeout);query]``
188
153
189
154
`":host:port"` can also be a symbol as `` `:host:port``.
190
155
156
+
157
+
## :fontawesome-solid-handshake-slash: `hclose`
158
+
159
+
_Close a connection to a file or process_
160
+
161
+
```syntax
162
+
hclose x hclose[x]
163
+
```
164
+
165
+
Where `x` is a connection handle, closes the connection, and destroys the handle.
166
+
The corresponding integer can then no longer be applied to an argument.
167
+
168
+
```q
169
+
q)show h:hopen `::5001
170
+
3i
171
+
q)h"til 5"
172
+
0 1 2 3 4
173
+
q)hclose h
174
+
q)h"til 5"
175
+
': Bad file descriptor
176
+
```
177
+
178
+
Async connections: pending data on the connection handle is not sent prior to closing.
179
+
If flushing is required prior to close, this must be done explicitly.
180
+
(Since V3.6 2019.09.19)
181
+
182
+
```q
183
+
q)neg[h][];hclose h;
184
+
```
185
+
186
+
!!! info "`hclose` before V3.6 2019.09.19"
187
+
188
+
If the handle refers to a WebSocket, `hclose` blocks until any pending data on the connection handle has been sent.
0 commit comments