Comments (4)
What exactly means "no result". Is there null returned or is there a wrong reason code?
from mqttnet.
public async Task Foo(byte[] data)
{
await _mqttPublisher.Publish(topic1, data);
await _mqttPublisher.Publish(topic2, data); // continues even though we didn't get a result nor exception
await _mqttPublisher.Publish(topic3, data);
}
How do you expect to get a result if you don't read it into a variable? await _mqttPublisher.Publish(topic2, data);
will always proceed unless an exception is thrown and that is alright?
What about something like:
public async Task Foo(byte[] data)
{
var x = await _mqttPublisher.Publish(topic1, data);
var y = await _mqttPublisher.Publish(topic2, data); // continues even though we didn't get a result nor exception
var z = await _mqttPublisher.Publish(topic3, data);
}
from mqttnet.
What I would expect is that this line:
var result = await _mqttClient.PublishAsync(applicationMessageBuilder.Build(), CancellationToken.None);
always have a result stored in that property before returning. And if there is an exception that an exception is thrown. Now we see that it publishes the mqtt command but before the PublishAsync ends we are already executing the next commands
from mqttnet.
@don-pironet-hatch Please provide a full running example to that we can try to reproduce the problem. The code you posted contains a _mqttPublisher where the implementation is not clear and how it works internally.
from mqttnet.
Related Issues (20)
- Last Will not working? HOT 2
- [FR] Protobuf HOT 4
- Linux - when Upgrading from version 4.3.3.952 to 4.3.4.1084 the client always raises the exception «None of the discovered or specified addresses match the socket address family» HOT 7
- Restore messages per client/subscription HOT 2
- No connection could be made because the target machine actively refused it. HOT 1
- Breaking Change in MqttClientTcpOptions with 4.3.5.1141 HOT 5
- Managed MQTT client hangs when trying to disconnect using `StopAsync()` in Unity Engine HOT 5
- UWP PublishAsync forever hangs
- Event when pending ApplicationMessage was published HOT 1
- MqttClientOptionsBuilder.WithTcpServer:The “_remoteEndPoint” is missing instantiation
- Json serialized messages wont get published to the broker. HOT 3
- Connecting To localhost...Could not open connection to the host, on port 1883: Connect failed HOT 2
- The type or namespace name 'Options' does not exist in the namespace 'MQTTnet.Client' (are you missing an assembly reference?) HOT 6
- Connect async via TLS is different on Windows and Linux. HOT 3
- Issue in MQTTnet version 4.3.6.1152 HOT 1
- WebSocket connection to 'ws://127.0.0.1:10086/' failed: HOT 1
- Does this support client TLS-PSK? HOT 1
- Server How to start multiple ports? HOT 1
- Support AUTH packet exchange while connecting MqttClient
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 mqttnet.