MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / WebGLOnMessage

Method WebGLOnMessage

sdks/csharp/src/WebSocket.cs:97–107  ·  view source on GitHub ↗
(int socketId, IntPtr dataPtr, int length)

Source from the content-addressed store, hash-verified

95 }
96
97 [AOT.MonoPInvokeCallback(typeof(Action<int, IntPtr, int>))]
98 private static void WebGLOnMessage(int socketId, IntPtr dataPtr, int length)
99 {
100 try {
101 byte[] data = new byte[length];
102 Marshal.Copy(dataPtr, data, 0, length);
103 Instance?.HandleWebGLMessage(socketId, data);
104 } catch (Exception e) {
105 UnityEngine.Debug.LogError($"Error handling message: {e}");
106 }
107 }
108
109 [AOT.MonoPInvokeCallback(typeof(Action<int, int, IntPtr>))]
110 private static void WebGLOnClose(int socketId, int code, IntPtr reasonPtr)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected