Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions doc/channel.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*channel.txt* For Vim バージョン 9.2. Last change: 2026 Apr 06
*channel.txt* For Vim バージョン 9.2. Last change: 2026 Apr 14


VIM リファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -131,7 +131,7 @@ Vimを起動し、リスニングチャネルを作成する: >
endfunc

" ポート 8765 でリッスンを開始する
let server = ch_listen('localhost:8765', {"callback": "OnAccept"})
let server = ch_listen('8765', {"callback": "OnAccept"})

別の Vim インスタンス (または任意のプログラム) から接続できる: >
let channel = ch_open('localhost:8765')
Expand Down Expand Up @@ -633,8 +633,7 @@ ch_info({handle}) *ch_info()*
"status" ch_status() と同様に、"open", "buffered" ま
たは "closed"
ch_open() で開いた場合:
"hostname" アドレスのホスト名
"port" アドレスのポート
"port" ループバック上のポート
"path" Unix ドメインソケットのパス
"sock_status" "open" または "closed"
"sock_mode" "NL", "RAW", "JSON" または "JS"
Expand Down Expand Up @@ -664,21 +663,21 @@ ch_info({handle}) *ch_info()*
戻り値の型: dict<any>

ch_listen({address} [, {options}]) *E1573* *E1574* *ch_listen()*
着信チャネル接続を {address} で待機する。
これは、既存のサーバーに接続する |ch_open()| とは異なり、サー
バー側のチャネルを作成する。

ループバックのポート、または UNIX ドメインソケットの {address}
で、チャネル接続の着信を待機する。これは、既存のサーバーに接続
する |ch_open()| とは異なり、サーバー側のチャネルを作成する。
チャネルを返す。|ch_status()| を使用して、失敗したかどうかを確
認すること。

{address} は文字列である。受け入れられる形式については
|channel-address| を参照。ただし、セキュリティ上の理由から、す
べてのインターフェイスにバインドすることはできません。
|channel-address| を参照。ただし、TCP ソケットの場合はポートの
みを設定でき、セキュリティ上の理由からループバックアドレスにバ
インドされる。
Note: IPv6 はまだサポートされていない。

{options} が指定されている場合は、|Dictionary| である必要があ
る。
|channel-open-options| を参照
|channel-open-options| を参照
{options} の "callback" は、新しい接続が受け入れられたときに呼
び出される。このコールバックは、新しいチャネルとクライアントア
ドレス (文字列形式、例: "127.0.0.1:12345") の 2 つの引数を受け
Expand Down
18 changes: 9 additions & 9 deletions en/channel.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*channel.txt* For Vim version 9.2. Last change: 2026 Apr 06
*channel.txt* For Vim version 9.2. Last change: 2026 Apr 14


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -132,7 +132,7 @@ Start Vim and create a listening channel: >
endfunc

" Start listening on port 8765
let server = ch_listen('localhost:8765', {"callback": "OnAccept"})
let server = ch_listen('8765', {"callback": "OnAccept"})

From another Vim instance (or any program) you can connect to it: >
let channel = ch_open('localhost:8765')
Expand Down Expand Up @@ -637,8 +637,7 @@ ch_info({handle}) *ch_info()*
"status" "open", "buffered" or "closed", like
ch_status()
When opened with ch_open():
"hostname" the hostname of the address
"port" the port of the address
"port" the port on loopback
"path" the path of the Unix-domain socket
"sock_status" "open" or "closed"
"sock_mode" "NL", "RAW", "JSON" or "JS"
Expand Down Expand Up @@ -668,14 +667,15 @@ ch_info({handle}) *ch_info()*
Return type: dict<any>

ch_listen({address} [, {options}]) *E1573* *E1574* *ch_listen()*
Listen on {address} for incoming channel connections.
This creates a server-side channel, unlike |ch_open()|
which connects to an existing server.
Listen on {address} - port on loopback or UNIX domain socket
for incoming channel connections. This creates a server-side
channel, unlike |ch_open()|which connects to an existing server.
Returns a Channel. Use |ch_status()| to check for failure.

{address} is a String, see |channel-address| for the possible
accepted forms, however binding to all interfaces is not
allowed for security reasons.
accepted forms, however in case of TCP sockets it allows to
set only a port and binds to loopback address for
security reasons.
Note: IPv6 is not yet supported.

If {options} is given it must be a |Dictionary|.
Expand Down