stack overflow while using socket in hololens 2

金旺 王 25 Reputation points
2023-09-08T01:18:53.8366667+00:00

am developing a app for hololens2 with unity 2019.4.4f & Vs2017 & holones 2.
in the unity editor, I can send & receive TCP packets with socket very well, but when i deploy is to the real hololens 2,. the APP will crash soon because of "stack overflow"
below is my code and the error info:

error info:
Exception thrown at 0x766053DF in TIDVoice.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x10D6D840.
Exception thrown at 0x766053DF in TIDVoice.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x10D6D840.
Exception thrown at 0x740E61E6 (vcruntime140d_app.dll) in TIDVoice.exe: 0xC00000FD: Stack overflow (parameters: 0x00000001, 0x10C72FF8).
Unhandled exception at 0x740E61E6 (vcruntime140d_app.dll) in TIDVoice.exe: 0xC00000FD: Stack overflow (parameters: 0x00000001, 0x10C72FF8).

Exception thrown at 0x766053DF in TIDVoice.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x10D6D840.
Exception thrown at 0x766053DF in TIDVoice.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x10D6D840.
Exception thrown at 0x77025D38 (ntdll.dll) in TIDVoice.exe: 0xC0000005: Access violation writing location 0x10C70FBC.

my code:

public class MediaPlay : MonoBehaviour
{
.....................
#region private field
TcpClient client = new TcpClient("192.168.124.102", 12345); ===》 if delete this line, everything is ok
.......................
// serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); ====> this line has the same reult

anyone else has meet the same problem? need your support , thanks very much

HoloLens Development
HoloLens Development
HoloLens: A family of Microsoft self-contained, holographic devices that enable engagement with digital content and interaction with holograms in the surrounding environment.Development: The process of researching, productizing, and refining new or existing technologies.
390 questions
{count} votes

1 answer

Sort by: Most helpful
  1. 金旺 王 25 Reputation points
    2023-10-13T03:16:17.0233333+00:00

    i know the reason now, in unity hololens 2 , only async socket can be used

    1 person found this answer helpful.
    0 comments No comments