title: R socketConnection - connection not open for reading
body: <p>I'm trying to call the <code>load()</code> function on a <code>socketConnection</code>. When I establish the connection (between two R processes), I check the socket info and I see this:</p>
  
  <pre><code>&gt; s &lt;- socketConnection(host = "localhost", 12345, server = FALSE, blocking=TRUE, open = "rb")
  &gt; s
          description               class                mode                text
  "-&gt;localhost:12345"          "sockconn"                "rb"            "binary"
               opened            can read           can write
             "opened"               "yes"               "yes"
  </code></pre>
  
  <p>The connection was opened successfully and it is readable (and in binary mode). If I now try to read from the socket, I get this:</p>
  
  <pre><code>&gt; load(s)
  Error in load(s) : connection not open for reading
  </code></pre>
  
  <p>Took me a while to figure out why I see the socket saying "can read=yes", while the error message is saying it is not readable. Turns out, the connection is being wrapped with a gzcon object when performing the <code>load()</code>. If I wrap it myself, I see this:</p>
  
  <pre><code>&gt; s
          description               class                mode                text
  "-&gt;localhost:12345"          "sockconn"                "rb"            "binary"
               opened            can read           can write
             "opened"               "yes"               "yes"
  &gt; z &lt;- gzcon(s)
  &gt; z
                 description                      class
  "gzcon(-&gt;localhost:12345)"                    "gzcon"
                        mode                       text
                        "rb"                   "binary"
                      opened                   can read
                    "opened"                       "no"
                   can write
                       "yes"
  &gt; s
                 description                      class
  "gzcon(-&gt;localhost:12345)"                    "gzcon"
                        mode                       text
                        "rb"                   "binary"
                      opened                   can read
                    "opened"                       "no"
                   can write
                       "yes"
  </code></pre>
  
  <p>The gzcon converts the connection to unreadable.
  So my question is, how can I perform a load from a socket, or how I can force gzcon to keep the connection readable?</p>