简体   繁体   English

Fleck Websocket实施问题。 无法使用套接字发送

[英]Fleck websocket implementation issue. Unable to use socket.Send

I am currently trying to implement Websockets using Fleck , and somewhat merging it with this BLE sample . 我目前正在尝试使用Fleck实现Websockets ,并将其与BLE示例进行某种程度的合并。 My ultimate goal for this is to communciate received heart rate data from a BLE device to websocket, and then receive it in unity. 我的最终目标是将从BLE设备接收到的心率数据传送到websocket,然后统一接收。

My issue right now is that I am unable to use the Fleck socket.Send(message) function inside visual studio inside the BLE sample code. 我现在的问题是我无法在BLE示例代码中的Visual Studio中使用Fleck socket.Send(message)函数。

When I type it, it's underlined in red and comes up with the error that "Reference to type 'Task' claims it is defined in 'System.Runtime', but it could not be found. " 当我键入它时,它用红色下划线标出,并出现一个错误,即“参考'任务'类型声称它是在'System.Runtime'中定义的,但是找不到。”

I'm pretty new to C#, Websockets and Visual Studio in general. 一般来说,我对C#,Websockets和Visual Studio还是很陌生。

What I did was reference the Fleck.dll in visual studio. 我所做的是在Visual Studio中引用Fleck.dll The only one that worked was the dll inside Fleck/bin/Debug/netcoreapp2.0 , then declared the WebSocketServer etc. socket.OnOpen(), onClose() and onMessage() all work. 唯一起作用的是Fleck / bin / Debug / netcoreapp2.0中的dll,然后声明了WebSocketServer等。socket.OnOpen(),onClose()和onMessage()都可以工作。 However, it just doesn't like socket.Send. 但是,它只是不喜欢socket.Send。

I tried manually adding a reference to the System.Runtime.dll , however it said that the component is already automatically referenced by the build system. 我尝试手动添加对System.Runtime.dll的引用,但是它表示该组件已由构建系统自动引用。

Any assistance would be greatly appreciated! 任何帮助将不胜感激!

Update: Fixed it by just updating the NET core universal windows platform in Nuget Package Manager inside Visual Studio. 更新:通过仅在Visual Studio内部的Nuget软件包管理器中更新NET核心通用Windows平台来解决此问题。 It was using an outdated version. 它使用的是过时的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM