HoloLens 网络套接字

HoloLens websockets

我正在尝试使用 System.Net.Sockets; 为 HoloLens 编写一个 websocket 客户端。 它在 Unity 中工作,但是当我尝试为 HoloLens 构建它时,出现如下错误:

Socket does not contain a definition of Connect

Unity 的 websocket 库也不起作用。 如何为 HoloLens 创建 websocket 客户端?

我相信你需要在NETFX_COREWINDOWS_UWP定义中使用websockets for UWP for the hololens and use System.Net.Sockets for the Unity Editor and wrap the UWP code

您可以使用 WWW 统一对象来发送和接收 http requests/answers!我使用这个在 hololens 上连接 http 协议没问题。