MangoAutomation / ma-core-public

Mango Automation Core public code
Other
77 stars 50 forks source link

Potential infinite loop in serial server socket bridge #1433

Open Puckfist opened 5 years ago

Puckfist commented 5 years ago

The loop for handling a connected socket at SerialServerSocketBridge line 229 or thereabouts will not exit unless the listener consumes the bytes from the serial event or the exceptions occur. If a serial data source is using a terminator, it won't consume bytes from the buffer unless it has a prospective message. Therefore, one can trigger this infinite looping by filling the buffer (with no terminators) on a serial data source with no timeout

terrypacker commented 5 years ago

@Puckfist this seems to be the expected/desired behavior. So long as the socket connection remains open the SerialServerSocketBridge's thread will continue to check for new input which is expected I think.

I think we will need more information. I did some testing using netcat and echo does not cause this as the port is opened and closed for each message sent.

Also this is confusing as you cannot create a serial data source with no timeout, are you referring to the serial port's configuration? on a serial data source with no timeout?