baalexander / rosnodejs

A ROS client library using node.js
http://baalexander.github.com/rosnodejs/
MIT License
36 stars 8 forks source link

Optimize Connection Header detection #1

Open baalexander opened 13 years ago

baalexander commented 13 years ago

Using TCPROS, a Connection Header can be sent as part of the message buffer or, when using repeat messages, as its own buffer.

To check if the buffer is a connection header or message, the getMessageFromBuffer in tcpros.js converts the buffer to a String and checks for required properties sent by the publisher, like type. This is inefficient and needs a better way to detect if a connection header buffer. This could happen in subscriber.js as state isn't really assumed in tcpros.js.