简体   繁体   English

为什么 TCP 连接在 HoloLens 模拟器(第一代)中不起作用?

[英]Why TCP connection doesn't work in HoloLens emulator (1st generation)?

I searched the entire Internet looking for information, but it did not help.我搜索了整个互联网寻找信息,但没有帮助。 The main problem: I can't connect from the HoloLens emulator to my server.主要问题:我无法从 HoloLens 模拟器连接到我的服务器。

How my code works:我的代码如何工作:

I am starting the server.我正在启动服务器。 He is waiting for connections.他在等待连接。 When a client connects to the server, it sends a message.当客户端连接到服务器时,它会发送一条消息。 In this case, this is "This is a message from one of your clients."在这种情况下,这是“这是来自您的一位客户的消息”。 服务器_1

服务器_2

What is at the moment:目前是什么:

  1. The server that opens at the IP that recommended in this article.本文推荐的IP上打开的服务器

     System.Net.IPAddress ipAddr = System.Net.IPAddress.Parse("192.168.37.97"); IPEndPoint ipEndPoint = new IPEndPoint(ipAddr, 11000); Socket sListener = new Socket(ipAddr.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
  2. I took the IPs from cmd where I wrote 'ipconfig'.我从我写'ipconfig'的cmd中获取了IP。 配置文件

  3. If we talk about the parameters of the HoloLens emulator, then here it is.如果我们谈论 HoloLens 模拟器的参数,那么它就是。 全息IP


You can see that the ip addresses are different in the emulator and in 'ipconfig'.你可以看到模拟器和'ipconfig'中的ip地址是不同的。 Let's try to put the emulator ip in the server address (just in case we will check).让我们尝试将模拟器 ip 放在服务器地址中(以防万一我们会检查)。 例外

As you can see, an error appears.如您所见,出现错误。 "The requested address is not valid in its context" . "The requested address is not valid in its context"

And what do I want?我想要什么?

If there is any exact step-by-step instruction on how to connect from the emulator to my server, I will be very grateful.如果有任何关于如何从模拟器连接到我的服务器的确切分步说明,我将不胜感激。

Below I will leave links that have helped many, but not me.下面我将留下对很多人有帮助的链接,但对我没有帮助。 (Maybe because I'm a junior) (可能因为我是小学生)

Links:链接:

1) https://forums.hololens.com/discussion/309/emulator-and-localhost 1) https://forums.hololens.com/discussion/309/emulator-and-localhost

2)https://forums.hololens.com/discussion/comment/934/#Comment_934 2)https://forums.hololens.com/discussion/comment/934/#Comment_934

3)https://docs.microsoft.com/en-us/windows/uwp/networking/sockets ( Note: As a consequence of network isolation, Windows disallows establishing a socket connection...) 3)https://docs.microsoft.com/en-us/windows/uwp/networking/sockets注意:由于网络隔离,Windows 不允许建立套接字连接...)

4) https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/ 4) https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/

5) HoloLens emulator connect to server on LAN 5) HoloLens 模拟器连接到局域网上的服务器

The HoloLens Emulator can connect to a server on your host PC (or any other device reachable on the network to which your host PC is attached) as long as the server is listening on the host's IP, not the emulator IP, and your host firewall is configured to allow inbound connectivity on the port you choose. HoloLens 模拟器可以连接到主机 PC 上的服务器(或主机 PC 连接到的网络上可访问的任何其他设备),只要该服务器正在侦听主机的 IP,而不是模拟器 IP 和主机防火墙配置为允许您选择的端口上的入站连接。 For example, if your host is 10.0.0.1, your emulator is 192.168.0.1 and you want to use port 8080, the server should be listening on 10.0.0.1:8080, the firewall should be configured to allow inbound connections on port 8080 and the client should connect to that address and port.例如,如果您的主机是 10.0.0.1,您的模拟器是 192.168.0.1 并且您想使用端口 8080,则服务器应侦听 10.0.0.1:8080,防火墙应配置为允许端口 8080 上的入站连接和客户端应该连接到该地址和端口。

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

相关问题 Hololens - UserConsentVerifier 不适用于 Hololens 第一代 - Hololens - UserConsentVerifier not working on Hololens 1st Generation jQuery Click-在第1页加载时不起作用,但是在重新加载页面时起作用 - jQuery Click - Doesn't work when page 1st loaded, but works if page is reloaded c#DataSet按日期选择不适用于1月1日 - c# DataSet select by date doesn't work for the 1st of January WCF端点配置:第二个端点根本不起作用,第一个端点似乎不受绑定影响 - WCF endpoint configuration: 2nd endpoint doesn't work at all, 1st endpoint doesn't seem affected by binding 无法部署到HoloLens模拟器 - Can't deploy to HoloLens emulator 为什么在客户端拆分TCP消息不起作用? - Why does splitting TCP message on client side doesn't work? 为什么零长度的Send()在错误的TCP套接字连接上不会失败? - Why doesn't a zero-length Send() fail on a bad TCP socket connection? 指数数组的边界之外。 在第一个示例中有效,但在第二个示例中无效 - Index was outside the bounds of the array. works in 1st example but doesn't in second Hololens(第一代和第二代)Unity 应用程序 - 与 Azure AD 集成 - Hololens (1st and 2nd gen) Unity App - Integrate with Azure AD 自动刷新TCP流不起作用 - Auto flush of tcp stream doesn't work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM