title: Check if node net socket has work in progress
body: <p>Is there a possibility to check if a <a href="https://www.npmjs.com/package/net" rel="nofollow">net</a> socket is currently working (i.e.: actively sending or receiving data)? 
  I checked the <a href="https://nodejs.org/api/net.html" rel="nofollow">documentation</a>, but I couldn't find anything related.</p>
  
  <p>In my case, I have an open socket between a socket client and the node server. When a HTTP client makes a request, the server communicates under the hood with the socket client. </p>
  
  <p>The problem is that if <code>list-files</code> is currently in progress and I request <code>rename-file</code>, the operation is blocked by the first request. My solution is to have multiple open sockets between node server and socket client, in order to parallelise requests. </p>
  
  <p>In order to know which socket I can use for a request, I need to know if it is idle or working already on another request (e.g.: especially when a file download/upload is in progress).</p>
  
  <pre><code>var clientSockets = []
  
  router.post('/list-files', function(req, res) {
      var clientSockets = clientSockets.filter(function(currSocket) {
          return currSocket.userID === "user1@example.com"
      })
  
      // What should I do here?
      // var availableClientSocket = clientSockets.filter(
  
      writeMessageToSocket(availableClientSocket, socketReq.fromHttpReq(req))
      readMessageFromSocket(availableClientSocket, socketRes)
  
      res.write(socketRes)
  }
  
  router.post('/rename-file', function(req, res) {
      // ...
  }
  </code></pre>