-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is In-Memory communication channels supported? #2100
Comments
I had this requirement a year ago, but after reviewing the documentation and issues, I found that MQTTnet does not provide a ready-to-use in-memory communication channel. It needs to be implemented manually. I’m not sure if this feature is available now. If it is still not provided, implementing this feature is quite easy. You just need to implement IMqttClientAdapterFactory, IMqttChannel, and IMqttServerAdapter. |
Thanks for your response. I did exactly that, since I noticed that it's not really supported. I have a working in-memory version now. |
@mauroa |
I'm attaching a simple console app that I made with the in-memory support. It uses MemoryStream and a series of thread synchronization and lock mechanisms to allow reading and writing correctly in both client and server sides, given the nature of the MemoryStream. If you find improvements to make, please let me know. |
Would this be easier to implement using |
The documentation mentions it:
Extensible communication channels (e.g. In-Memory, TCP, TCP+TLS, WS)
, however I'm not sure if this is really supported and how I should configure it.I ask this in order to avoid the firewall prompt to allow opening a TCP port when starting the MQTT server, in cases where the MQTT connection and messages exchange will be performed in-process.
Thanks
The text was updated successfully, but these errors were encountered: