[英]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 模拟器连接到我的服务器。
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."
在这种情况下,这是“这是来自您的一位客户的消息”。
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);
I took the IPs from cmd where I wrote 'ipconfig'.我从我写'ipconfig'的cmd中获取了IP。
If we talk about the parameters of the HoloLens emulator, then here it is.如果我们谈论 HoloLens 模拟器的参数,那么它就是。
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"
。
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.