custom transport receiving issues
See original GitHub issueHi,
I’m trying to write a custom transport which works over a character device (in this case a serial port exposed by qemu into windows). The basic idea here is that I need to use CreateFile
/ReadFile
/WriteFile
to transfer data over a “file” provided by the driver. In order to work with the file it has to be opened in “overlapped” mode, and by nature reads and write are asynchronous. I’ve implemented all of this wrapped in a Stream
subclass, for writes I just send-and-forget, whereas for reads I have an internal long running Task
which reads from the file periodically and buffers the results to an internal circular buffer.
For the past hour I’ve been scratching my head because my custom transport was throwing an ObjectDisposedException
and I couldn’t for the life of my figure out where I had screwed the code up. It finally occurred to me to check the source for this library and I found the following: https://github.com/Azure/amqpnetlite/blob/master/src/Framing/Reader.cs#L56. What I think is happening is that AMQP.Net Lite is trying to make a read before the internal thread has picked up any response, getting a read size of 0 and throwing the ObjectDisposedException
. I’m not sure how to get around this problem, so any help would be welcome!
Are there any specific notes on requirements for implementing a custom transport?
UPDATE: I should have mentioned this is being implemented against .NET 4.0
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (12 by maintainers)
Top GitHub Comments
@xinchen10
Custom transport communicating over a virtio-serial port in windows on the right side. A small proxy I wrote using
amqp10
in node.js on the top left, which proxies to a localqpidd
instance. Bottom left is a listener usingamq10
again to receive messages off theamq.topic
exchange. Looks like the experiment worked 😃I’m definitely willing to contribute code to that, this stuff is by no means proprietary or otherwise encumbered. Plus, I’d appreciate if someone who knows C# better than I would look it over for obvious inefficiencies 😄