title: tcp client in c that send and listens : concept
body: <p>I'm looking into making a tcp client in C.
  But before I start I would like some advise from you.</p>
  
  <p>The client is for controlling lights and other devices.</p>
  
  <p>With this client I will need to send commands, but I can also receive events when a light is turned off by someone.</p>
  
  <p>Just sending commands with sockets is no problem.
  But at the same time I have to read for incoming packages.</p>
  
  <p>How is this best solved?
  Do I need to use threads or can I solve this with something like libevent?</p>
  
  <p>How do most people implement something like this?</p>
  
  <p>This library should be as portable as possible. (linux, unix, windows, ...)</p>
  
  <p>(I'm not looking for code, but just a best approach)</p>