I am currently developing an application for the HoloLens 2 with the MRTK and MLAPI as the networking backend. I have a server running in a separate Unity project with identical assets on my computer while the client is running on the HoloLens, both on the same LAN. When the client is run using Holographic Remoting through the HoloLens, the connection initiates successfully and everything works. When the client is deployed directly to the HoloLens and run there, a connection cannot be established and the server doesn't even see the client trying to connect. This issue is similar to this one. I have verified that the InternetClient, InternetClientServer, and PrivateNetworkClientServer capabilities are all enabled on the device. I have also verified that the devices are in fact able to communicate outside of the application by running a simple web server on my computer and connecting to it through the HoloLens. The port and address the client is connecting to is also correct.
Edit with some more info: I'm using Unity 2019.4.19f1, MRTK 2.5.3, and MLAPI 0.1.0. I am also using the Ruffles transport for MLAPI, though this also occurs with the standard Unet transport (I've just found the Ruffles debug messages are more useful so I'm using it). Nothing appears in the console on the server and the client has pretty standard messages:
Socket Initialized
Creating NetworkThread #0
Creating SocketThread #0
Starting NetworkThread #0
Starting SocketThread #0
Started 2 threads
Attempting to connect to 192.18.1.213:7777
Using time based connection challenge. Calculating with difficulty 20
Found has collision after 1945710 attempts.
Using time based connection challenge. Writing solve with difficulty 20
Sending connection request to 192.168.1.213:7777
Resending ConnectionRequest with challenge
Resending ConnectionRequest with challenge
Resending ConnectionRequest with challenge
Resending ConnectionRequest with challenge
Resending ConnectionRequest with challenge
Disconnecting client because handshake was not started
[MLAPI] Disconnect Event from 1
[MLAPI] StopClient
[MLAPI] Shutdown
Joining SocketThread #0
Joining NetworkThread #0
Joined 2 threads
Releasing all memory held by MemoryManager to GC
Releasing MemoryWrappers to GC
Released 0 MemoryWrappers to GC
Releasing HeapPointers to GC
Released 0 HeapPointers to GC
Releasing HeapMemory to GC
Released 1 HeapMemories to GC
Released all memory held by MemoryManager to GC