stevenlovegrove / MqttDotNet

.net Implementation of the client half of the MQTT messaging protocol. MQTT is a lightweight, open specification publish and subscribe protocol cheifly developed by IBM. Details of MQTT can be found at http://mqtt.org.
MIT License
153 stars 91 forks source link

Improve network writing. #4

Closed ralight closed 11 years ago

ralight commented 11 years ago

Using NetworkStream.WriteByte() results in multiple TCP packets being sent per MQTT packet, which is very inefficient. This commit uses a MemoryStream to amalgamate the whole MQTT packet, then writes it to the NetworkStream.

stevenlovegrove commented 11 years ago

Great, thanks!