zephyr.js icon indicating copy to clipboard operation
zephyr.js copied to clipboard

[net] Improve the information for socket properties

Open cuiyanx opened this issue 7 years ago • 1 comments

Description

Please Improve the information for socket properties.

// Socket properties
    Number bufferSize;    // Size of read buffer
    Number bytesRead;     // Total bytes read for the socket
    Number bytesWritten;  // Total bytes written for the socket

Those are undefined.

Test Code

Simple test:

console.log("socket.bufferSize:", typeof sock.bufferSize, sock.bufferSize);
console.log("socket.bytesRead:", typeof sock.bytesRead, sock.bytesRead);
console.log("socket.bytesWritten:", typeof sock.bytesWritten, sock.bytesWritten);

Steps to Reproduction

Actual Result

selection_001

Expected Result

Be defined.

Test Builds

Branch Commit Id Target Device Test Date Result
master 8a5bafc5 Arduino 101 May 18, 2017 Fail

Additional Information

cuiyanx avatar May 18 '17 02:05 cuiyanx

This is really an enhancement, part of the Node.js API we haven't supported. This would require extra bookkeeping and I don't think it's of great value to the app developer in this environment, so I'm also lowering the priority.

grgustaf avatar Jan 11 '18 18:01 grgustaf