Comments (2)
@andypiper, please check 4513742 commit, @turtleDeng fixed this issue?
from cocoamqtt.
CocoaMQTTFramePublish pack/unpack error, Fixed in 1.0 release:
class CocoaMQTTFramePublish: CocoaMQTTFrame {
func unpack() {
//topic
var msb = data![0], lsb = data![1]
let len = UInt16(msb) << 8 + UInt16(lsb)
var pos: Int = 2 + Int(len)
topic = NSString(bytes: [UInt8](data![2...(pos-1)]), length: Int(len), encoding: NSUTF8StringEncoding) as? String
//msgid
if qos == 0 {
msgid = 0
} else {
msb = data![pos]; lsb = data![pos+1]
msgid = UInt16(msb) << 8 + UInt16(lsb)
pos += 2
}
//payload
let end = data!.count - 1
payload = [UInt8](data![pos...end])
}
override func pack() {
variableHeader += topic!.bytesWithLength
if qos > 0 {
variableHeader += msgid!.hlBytes
}
}
}
from cocoamqtt.
Related Issues (20)
- Could you tag the latest commit? HOT 1
- Type 'MQTTClient' does not conform to protocol 'CocoaMQTTDelegate'
- Why should the message qos of dup=0 be set to qos0?
- Disconnection doesn't always throw DidDisconnect HOT 1
- One-way certification issue HOT 4
- How to connect to a broker on the network HOT 4
- Example does nothing when connected to different broker HOT 1
- SwiftPackage incompatibility with SocketIO HOT 2
- Keep receiving a message that has been consumed HOT 2
- Impossibile compiling due to Starscream 4.0.6 HOT 2
- Can't receive retained message HOT 2
- Archiving failed while running this command HOT 1
- When recovering session, frame (FramePublish) topic is empty HOT 4
- Not able to connect hivemq.cloud TLS/SSL port(8883). HOT 4
- Failed to connect to 8883 HOT 3
- Could not connect to MQTT 5.0 HOT 1
- How to get this to work on Xcode 15 HOT 3
- QOS 2 can deliver a message twice
- provide working example
- Privacy Manifest HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cocoamqtt.