Skip to content

Commit e8a43ec

Browse files
authored
Merge pull request #305 from sshanks-kx/hopen
moved details into hopen section
2 parents 56e5cf1 + bfac255 commit e8a43ec

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

docs/ref/hopen.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -59,42 +59,7 @@ hopen each(`:mysymbol;
5959
(":localhost:5000";1000))
6060
```
6161

62-
63-
## :fontawesome-solid-handshake-slash: `hclose`
64-
65-
_Close a connection to a file or process_
66-
67-
```syntax
68-
hclose x hclose[x]
69-
```
70-
71-
Where `x` is a connection handle, closes the connection, and destroys the handle.
72-
The corresponding integer can then no longer be applied to an argument.
73-
74-
```q
75-
q)show h:hopen `::5001
76-
3i
77-
q)h"til 5"
78-
0 1 2 3 4
79-
q)hclose h
80-
q)h"til 5"
81-
': Bad file descriptor
82-
```
83-
84-
Async connections: pending data on the connection handle is not sent prior to closing.
85-
If flushing is required prior to close, this must be done explicitly.
86-
(Since V3.6 2019.09.19)
87-
88-
```q
89-
q)neg[h][];hclose h;
90-
```
91-
92-
!!! info "`hclose` before V3.6 2019.09.19"
93-
94-
If the handle refers to a WebSocket, `hclose` blocks until any pending data on the connection handle has been sent.
95-
96-
97-
## :fontawesome-solid-database: Files
62+
### :fontawesome-solid-database: Files
9863

9964
If a filehandle specifies a non-existent filepath, it is created, including directories.
10065

@@ -118,9 +83,9 @@ q)r:htxt ` sv("asdf";"qwer")
11883
```
11984

12085

121-
## :fontawesome-solid-handshake: Processes
86+
### :fontawesome-solid-handshake: Processes
12287

123-
### Communication handles
88+
#### Communication handles
12489

12590
A communication handle specifies a network resource, and may include authentication credentials for it. There are four forms.
12691

@@ -168,7 +133,7 @@ q)(neg h)"a:2" / asynchronous (SET)
168133
```
169134

170135

171-
### :fontawesome-solid-thumbs-up: One-shot request
136+
#### :fontawesome-solid-thumbs-up: One-shot request
172137

173138
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.
174139

@@ -188,6 +153,41 @@ One-shot sync queries can now execute via `` `::[(":host:port";timeout);query]``
188153

189154
`":host:port"` can also be a symbol as `` `:host:port``.
190155

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.
189+
190+
191191
----
192192
:fontawesome-solid-book:
193193
[`.Q.Xf`](dotq.md#xf-create-file) (create file)

0 commit comments

Comments
 (0)