概要
wstpserver [--port port] [--interface interface]
选项
| -h, --help | 显示帮助信息 | |
| -l, --log-level n | 指定消息的详细程度 | |
| -f, --log-file fileNull | 将消息写入指定的文件 | |
| -a, --advertise [serviceNull | 如果出现,则将链接服务器播发为指定的服务 | |
| -p, --port port | 监听指定的端口 | |
| -i, --interface interface | 监听指定的接口 | |
| -c, --configuration-file file | 使用指定的配置文件 |
| error, 1 | 报告服务器启动/关闭错误并显示成功启动的消息 | |
| debug, 2 | 报告第 1 级的所有内容和所有调试消息 | |
| trace, 3 | 报告第 2 级的所有内容和处理的所有 WSTP 流量 |
如果没有使用 --log-level 或 -l,默认的日志详细程度被设为 error.
如果没有使用 --log-file 或 -f,或使用了但没有指定文件,则将消息写入 stdout.
如果使用了 --advertise [service] 或 -a [service],WSTPServer 将会把自己播发为 WSTPServer-Instance 或 WSTPServer-Instance-service,取决于是否指定了 service. WSTPServer 将记录它正在播发的服务名称.
如果没有使用 --advertise 或 -a,将不会播发链接服务器.
如果没有使用 --port 或 -p,链接服务器将监听端口 31415.
如果没有使用 --interface 或 -i,链接服务器将监听默认的网络接口. 将接口设置为 localhost 可使 WSTPServer 在本地网络上不可见.
详细信息
可到“WSTPServer 的介绍”查阅更多信息.
范例
$ wstpserver
WSTPServer: Logger (0, 2020-09-29 16:50:00): Information:
Using "/Applications/Mathematica.app/Contents/MacOS/WolframKernel" as a default kernel path
WSTPServer: Logger (0, 2020-09-29 16:50:05): Information:
Listening for new connections on port 31415
...
启动 WSTPServer,监听环回接口上的端口 12345:
$ wstpserver --port 12345 --interface 127.0.0.1
WSTPServer: Logger (0, 2020-09-29 16:54:25): Information:
Using "/Applications/Mathematica.app/Contents/MacOS/WolframKernel" as a default kernel path
WSTPServer: Logger (0, 2020-09-29 16:54:29): Information:
Listening for new connections on port 12345 and interface 127.0.0.1
...
文件
%APPDATA%\WSTPServer\wstpserver.conf | Windows | |
~/Library/Application Support/WSTPServer/wstpserver.conf | Macintosh | |
~/.config/WSTPServer/wstpserver.conf | Linux |
“WSTPServer 的介绍”中的“配置文件”部分提供了更多信息.
WOLFRAM 语言函数
WSTPServer`StartKernel — 启动一个内核(内核池之外),并返回内核的 ID.
WSTPServer`CloseKernel — 关闭一个内核.
WSTPServer`ConnectKernel — 将当前连接与指定的内核进行桥接.
WSTPServer`DisconnectKernel — 解除当前连接与其桥接的内核的桥接.
WSTPServer`SetKeepAlive — 设置在当前连接失效或桥接结束时,是否关闭与当前连接桥接的内核.
WSTPServer`SetAllowSilentKernelReplacement— 设置是否允许或不允许在内核死亡时无声地重新启动与当前连接桥接的内核.
WSTPServer`GetKernelID — 获取与当前连接桥接的内核的 ID.
WSTPServer`GetPoolName — 获取与当前连接桥接的内核池的名称.
WSTPServer`GetServerInformation — 获取所有池和内核的信息.
WSTPServer`SetReserveKernel — 设置当前内核在未桥接时,是否只能桥接给通过 ID 请求的客户.
“WSTPServer 的介绍”中的“命令语言”部分提供了更多信息.
配置变量
“WSTPServer 的介绍”中的“配置文件”部分提供了可能的配置变量和更多信息.