title: Storing and retrieving Sockets in Redis
body: <p>I am new to Node and Redis, so forgive me if I'm missing something crucial here. I am trying to store a Node.js net.Socket object in Redis, using the node_redis client, so I could reuse a connection made previously on this Socket. 
  I am storing the socket as a Value as a part of a "users" set:</p>
  
  <pre><code>client.sadd("users", username); //username is a string
  client.hmset(username, "ip", socket.remoteAddress, "connection", net.Socket(socket));
  </code></pre>
  
  <p>At a different point, I am retrieving this socket as:</p>
  
  <pre><code>    client.smembers("users", function(err, replies) {
  
              replies.forEach(function(reply,i){
              if(recipient == reply) {       //recipient is the username i've got
  
                      client.hget(reply, "connection", function(err, obj) {
                      console.log("socket's remoteaddress = " +  net.Socket(obj).remoteAddress);
          net.Socket(obj).write("asdasdasd");
              });
  
              }
      });
      });
  </code></pre>
  
  <p>But, the:
      net.Socket(obj).remoteAddress); is logged as 'undefined'.
  Also, 
       net.Socket(obj).write("asdasdasd"); gives me and error saying:</p>
  
  <p>Error: This socket is closed.</p>
  
  <p>So I guess my question is - can you store Sockets this way in Redis and expect them to work upon retrieval?  Is there a correct / better way to do this?</p>
  
  <p>P.S. I tried retrieving the Socket without the cast to net.Socket and it still didn't do any good. </p>