🐚 The "horn of plenty" – a symbol of abundance.
cornucopia-swift / cornucopiastreams Goto Github PK
View Code? Open in Web Editor NEWCornucopia Streams Library
License: MIT License
Cornucopia Streams Library
License: MIT License
🐚 The "horn of plenty" – a symbol of abundance.
Unfortunately there are no unit tests for this package yet.
I'm in the process of trying to (fork &) port https://github.com/arnecs/MQTTKit to Linux with Swift 5.4 on arm64 (Raspberry Pi). It uses Stream.getStreamsToHost(withName:port:inputStream:OutputStream)
that I've translated into Stream.CC_getStreamPair(to:) { result in }
and this works great on macOS, full MQTT functionality of the library is working on macOS. However, when I run it on Linux, the input stream has bytes available but the read always returns 0 bytes and the buffer is never populated with data.
The offending call is at https://github.com/arnecs/MQTTKit/blob/ec894640f1ea27f758b3f4d22722d83159773cd0/Sources/MQTTSession.swift#L248
Any idea on how to get this to work on Linux? Yes I know NIO might be more appropriate for linux, but for other reasons I can't use NIO.
TIA
As previously discussed, Cornucopia-Streams does not support TLS streams yet.
It would be cool to have that capability. Note that – since this product supports not only APPLE platforms – it also needs to work on Linux et. al. If we were to implement it, we would need to depend on a (hopefully small) TLS library for !APPLE platforms.
I don't have any immediate need for this feature, but would welcome a pull request.
(This is semi-forwarded by mickeyl/core-bluetooth-tool#1)
The URL for BLE streams, e.g., ble://fff0
right now only features a service UUID specifier. This is kind of unfortunate when it comes to multiple devices that might be servicing that. I propose to enhance the URL format like that:
ble://fff0
continues to work like before, it takes the first device that offers fff0
as its primary service.ble://fff0/F890A301-A464-D37C-AAFB-9374B546F7FE
will wait for the concrete device to appear and connect to its service.I have decided to (pretty much) rewrite CornucopiaStreams – the major reason being me and Swift having changed quite a bit over the last two years.
With 2.0, I'm trying to achieve two things – lifecycle and async correctness:
connect
call. Since many of the connectors do their work inherently asynchronously, this matches the problem domain much better. Moreover, cancelling now works correctly and there are no more memory leaks.While 1.0 was implemented as an extension on Foundation's Stream
, it felt more natural to move it into its own namespace. Therefore, an API change was inevitable. The last version of 1.0 is still available on the legacy
branch.
In some cases, we might want to show the BLE signal strength for the connected device.
Since we have to keep a strong handle to the connected peripheral over the lifetime of the connection anyways, it would be helpful to add a way to gather this.
Since we do not have any other handles, it has to use the out-of-band
scheme introduced with meta
.
Most connection providers do not handle cancellation yet.
For serial ports (URLs with the tty
scheme), we should allow configuring the bitrate.
For most platforms, this can happen before opening the file descriptor.
On macOS though, the bitrate needs to be configured after opening the port.
It's a bit annoying to put the burden for that on the call site.
Can you please show a vivid code to implement the bluetooth option of this library?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.