mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-08 07:13:39 +00:00
tcp search bugfix
when TCP device is discovered, wait to register it till socket closes. this way we don't have two sockets going at once!
This commit is contained in:
+9
-7
@@ -121,14 +121,16 @@ function TCPtest(ipAddr, pluginType, pluginConfig) {
|
||||
});
|
||||
client.on('data', (data) => {
|
||||
if (pluginConfig.searchOptions.validateResponse(data)) {
|
||||
DEVICE.registerDevice({
|
||||
type: pluginType,
|
||||
defaultName: pluginConfig.defaultName,
|
||||
port: pluginConfig.defaultPort,
|
||||
addresses: [ipAddr],
|
||||
});
|
||||
client.end(
|
||||
'',
|
||||
DEVICE.registerDevice({
|
||||
type: pluginType,
|
||||
defaultName: pluginConfig.defaultName,
|
||||
port: pluginConfig.defaultPort,
|
||||
addresses: [ipAddr],
|
||||
})
|
||||
);
|
||||
}
|
||||
client.end();
|
||||
});
|
||||
client.on('error', (err) => {
|
||||
// no device here
|
||||
|
||||
Reference in New Issue
Block a user