Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Runtime/Scripts/OscServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public sealed unsafe class OscServer : IDisposable
GCHandle m_BufferHandle;
byte* m_BufferPtr;

Action[] m_MainThreadQueue = new Action[16];
Action[] m_MainThreadQueue = new Action[mainThreadQueueSize];
int m_MainThreadCount;
private const int mainThreadQueueSize = 16;

readonly Dictionary<int, string> m_ByteLengthToStringBuffer = new Dictionary<int, string>();

Expand Down Expand Up @@ -111,6 +112,13 @@ public static bool Remove(int port)
}
return false;
}

/// <summary> Clear the MainThreadQueue of an OSC Server</summary>
public void ClearQueue()
{
m_MainThreadCount = 0;
m_MainThreadQueue = new Action[mainThreadQueueSize];
}

/// <summary>
/// Register a single background thread method for an OSC address
Expand Down