title: Is it ok to pass a socket to a function as const?
body: <p>Say I have a windows socket named <code>socket</code>. If <code>socket</code> was passed to a function which doesn't write to it. For instance say a function that sends a simple message/bytes to the client like <code>Hello you're connected to the server!</code>.
  For example:</p>
  <pre><code>void send_hello(SOCKET socket, char* data) {
      send(socket, data, sizeof(data), 0);
  }
  </code></pre>
  <p>Would it be safe to pass the socket as <code>const</code>? For example:</p>
  <pre><code>void send_hello(const SOCKET socket, char* data) {
      send(socket, data, sizeof(data), 0);
  }
  </code></pre>
  <p>Something in my brain tells me I should be passing <code>socket</code> as <code>const</code> rather than passing it as writeable memory. I know sockets are file descriptors, so I'm obviously confused as to how they work and if they're always or ever written to. However my code works when passing <code>socket</code> as <code>const</code>.</p>
  <p>My overall question is:</p>
  <p>Is it ok to pass a variable with the type <code>SOCKET</code> object as <code>const</code>? Or should said <code>SOCKET</code> always be in writeable memory regardless of scope?</p>