do not reject messages
allow loose message sending, but prevent handling errors
This commit is contained in:
parent
4f9f206b42
commit
4edd1d044e
1 changed files with 3 additions and 8 deletions
|
@ -176,18 +176,13 @@ function gotData(socket,data,UDPSocket){
|
||||||
let message=new Message;
|
let message=new Message;
|
||||||
message.load(data.shift());
|
message.load(data.shift());
|
||||||
|
|
||||||
// In case either `type` or `data` is missing we won't process this message.
|
// Only set the sock id if it is specified.
|
||||||
if (message.type === undefined || message.data === undefined) {
|
if (message.data && message.data.id){
|
||||||
this.log('Message is missing either `type` or `data` property, skipping message.');
|
sock.id=message.data.id;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.log('received event of : ',message.type,message.data);
|
this.log('received event of : ',message.type,message.data);
|
||||||
|
|
||||||
if(message.data.id){
|
|
||||||
sock.id=message.data.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.publish(
|
this.publish(
|
||||||
message.type,
|
message.type,
|
||||||
message.data,
|
message.data,
|
||||||
|
|
Loading…
Reference in a new issue