title: Create a virtual serial port connection over TCP
body: <p>I am developing an application that should be able to write to a virtual serial port and receive data through the same port from remote clients over network.</p>
  
  <p>The application runs on a linux server. I am new in using serial ports and I have some questions on this topic.</p>
  
  <p><strong>Clients</strong></p>
  
  <p>The client can establish a TCP connection to a server. When we setup a client, we have to provide the IP address of the server, a tcp port (usually 8080) and a virtual com port.</p>
  
  <p>The client then will automatically try to connect to the server.</p>
  
  <p><strong>Server</strong></p>
  
  <p>The server has a virtual com port, the same we set in the client config (e.g. COM1). When an application on the server writes data to this port, the data should be send to all clients connected via tcp. The response from the clients is send over TCP back to the server which can read it over the virtual serial port.</p>
  
  <p><strong>Question</strong> </p>
  
  <p>On windows I used a virtual serial port connector <a href="http://www.eterlogic.com/Products.VSPE.html">http://www.eterlogic.com/Products.VSPE.html</a> which did most of the work. However I want to solve this problem on linux machines.</p>
  
  <p>My question is, how can I create a TCP server that has a virtual serial port attached and can send/receive data through this port over TCP to listening clients?</p>