title: Sending data from a server to a client
body: <p>I have two projects, one for a server and one for a client. On the client, when I want to send data, I create a <code>QTcpSocket</code> member variable, and then send data using the <code>write()</code> method.</p>
  
  <p>On the server, I receive the information, but I want to send information back to the client. Specifically I'm trying to validate a user, so I'm sending the user name and password that they log in with on the client to the server, and I want to check that data against the database saved on the server, and then send information back to the client to verify that the information was correct.</p>
  
  <p>My problem is that I don't know how to send information from the server to the client. On the server, I have two member variables,<code>QTcpServer server;</code> and <code>QTcpSocket* client;</code>.</p>
  
  <p>I've looked through documentation on <code>QTcpServer</code> and it has no equivalent to <code>write()</code> as far as I'm aware, and the <code>QTcpSocket*</code> is the client that's currently connected to the server.</p>
  
  <p>I was thinking about creating a <code>QTcpSocket</code> variable on the server and sending information to the client the same way I send information to the sever, but that seems wrong because then the client would be behaving like a server, complete with a <code>QTcpServer</code> variable on the client.</p>
  
  <p>How else would I go about doing this?</p>