diff --git a/Runtime/Scripts/OscClient.cs b/Runtime/Scripts/OscClient.cs index 1235f3d..2560f92 100644 --- a/Runtime/Scripts/OscClient.cs +++ b/Runtime/Scripts/OscClient.cs @@ -16,9 +16,9 @@ public class OscClient /// Where this client is sending messages to public IPEndPoint Destination { get; } - public OscClient(string ipAddress, int port) + public OscClient(string ipAddress, int port, int bufferCapacity = 4096) { - m_Writer = new OscWriter(); + m_Writer = new OscWriter(bufferCapacity); m_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); if (ipAddress == "255.255.255.255") diff --git a/Runtime/Scripts/OscServer.cs b/Runtime/Scripts/OscServer.cs index cba77dc..53748d3 100644 --- a/Runtime/Scripts/OscServer.cs +++ b/Runtime/Scripts/OscServer.cs @@ -87,12 +87,12 @@ public void Start() /// /// The port to listen for incoming message on /// - public static OscServer GetOrCreate(int port) + public static OscServer GetOrCreate(int port, int bufferSize = 4096) { OscServer server; if (!PortToServer.TryGetValue(port, out server)) { - server = new OscServer(port); + server = new OscServer(port, bufferSize); PortToServer[port] = server; } return server;