/
Error 6037

Error 6037

If you have received Error 6037, you probably have a device that is not implemented properly. In particular a device should not do ANY long running operation in its Start() or Stop() methods. The reason for this is that Connexion reserves 20 Threads for performing Stop/Start operations on Channels. If those 20 threads are tied up servicing long running Start/Stop operations, than other Channels cannot be started or stopped. The rationale for the 20 thread limit comes from performance testing the starting of many channels. If the .NET framework is allowed to create threads on its own, the machine spends most of its time spinning up new threads. Each thread requires 1MB of stack, so the OS must allocate memory for each thread.

Here are some important considerations when developing your device.

  1. Don’t do ANY time consuming work in BaseDevice.Start() or BaseDevice.Stop().
  2. Use async/await where possible. This reduces the number of threads required by Connexion and results in better performance, and lower memory usage. This is especially important if the Connexion is running more than 100 channels.
  3. Prefer ProcessMessageAsync over ProcessMessage. Same as (2), but specific for processing messages. Also, ProcessMessage will be obsoleted in the next version of Connexion.
  4. Use BaseDevice.OnError to handle retrying. This uses async/await under the covers so there are no threads tied up sleeping. For an example of this please see: Sample Device with Retry (Sending)

Related content

Custom Device Considerations
Custom Device Considerations
More like this
Connexion v15 R3 (15.0.17080)
Connexion v15 R3 (15.0.17080)
More like this
Connexion 14.5 R10 (14.5.3508)
Connexion 14.5 R10 (14.5.3508)
More like this
Troubleshooting Connexion V14
Troubleshooting Connexion V14
More like this
Connexion 14.5 B2 (v14.5.196)
Connexion 14.5 B2 (v14.5.196)
More like this
Connexion 14.5 R8 (14.5.3491)
Connexion 14.5 R8 (14.5.3491)
More like this