在websocket示例中未定义值或构造函数'handShakeWithSubprotocol'

问题描述 投票:3回答:1

我使用的是.NET Core 2.0。我创建了一个F#控制台应用程序。在Program.fs中我放了Suave WebSocket example code.

除了第84行,所有内容都会编译:

path "/websocketWithSubprotocol" >=> handShakeWithSubprotocol (chooseSubprotocol "test") ws

我收到这个错误

error FS0039: The value or constructor 'handShakeWithSubprotocol' is not defined. Maybe you want one of the following:↔   handShakeResponse↔   handShake

我搜索了Suave源代码,然后找到了handShakeWithSubprotocol in WebSocket.fs。所以我认为这应该是可访问的,但编译器并不这么认为。

怎么可能出错?

你可以看到我的所有代码here

.net-core suave
1个回答
3
投票

我想我想出来了。

handShakeWithSubprotocol不在v 2.2.1中,这是我正在使用的Suave的版本。 Looks like it was added 4 months ago according to blame.

Link to the source code tagged v2.2.1

Looks like it's not in 2.3.0-beta either.,但有一个拉动请求说它可能会进入2.3.0。

© www.soinside.com 2019 - 2024. All rights reserved.