I am using the `OmmProvider` Class to implement a custom data provider. Essentially I am doing this as demonstrated by [this sample](https://github.com/Refinitiv/Real-Time-SDK/blob/master/CSharp/Ema/Examples/Training/IProvider/100_Series/100_MP_Streaming/IProvider.cs):
public static void Main(string[] args) { OmmProvider? provider = null; AppClient appClient = new AppClient(); FieldList fieldList = new FieldList(); OmmIProviderConfig config = new OmmIProviderConfig(); provider = new OmmProvider(config.Port("14002"), appClient); while (true) { fieldList.Clear(); fieldList.AddReal(22, 3991 + i, OmmReal.MagnitudeTypes.EXPONENT_NEG_2); fieldList.AddReal(30, 10 + i, OmmReal.MagnitudeTypes.EXPONENT_0); provider.Submit(new UpdateMsg().Payload(fieldList.Complete()), appClient.ItemHandle); Thread.Sleep(1000); } }
The problem is, without `Thread.Sleep()`, the provider will produce update faster than my consumer can consume, casuing the following exception:
Exception Type='OmmInvalidUsageException', Text='Failed to submit UpdateMsg. Reason: NO_BUFFERS. Error text: channel out of buffers chnl=Rssl Channel scktChannel: <Undefined> connected: True state: ACTIVE connectionType: SOCKET clientIP: 127.0.1.1 clientHostname: <omitted> pingTimeout: 60 majorVersion: 14 minorVersion: 1 protocolType: RWF userSpecObject: Client handle = 1 , errorId=FAILURE, errorText=Channel out of buffers', Error Code='-3'
Using `Thread.Sleep()` does work, but it does not seem to be a performant solution. Therefore, I am wondering how I can query the remaining space of the buffer, so that I can pause the producer if it is almost full.
Thanks,