title: Use RFC2217 network serial ports with Twisted Python?
body: <p>Is there a way to connect to an RFC2217 networked serial port with Twisted Python?</p>
  
  <p>Pyserial seems to support it via the <code>serial.serial_for_url("rfc2217://...")</code> <a href="http://pyserial.sourceforge.net/pyserial_api.html#urls">function</a>. And they indicate that twisted uses pyserial for managing serial connections, however <code>twisted.internet.serialport.SerialPort</code> seems to expect a port name or number which suggests it is just passing this to the <code>serial.Serial</code> constructor.</p>
  
  <p>I can use socat to create a PTY externally and pass the dev name to twisted which works fine, but I was wondering if I can bypass this step by using the pyserial support directly.</p>
  
  <pre><code>socat PTY,link=/dev/myport TCP:192.168.1.222:9001
  </code></pre>
  
  <p><em>Edit</em>: The <a href="http://pyserial.sourceforge.net/appendix.html#how-to">pyserial faq</a> suggests this modification for instantiating serial objects:</p>
  
  <pre><code>try:
      s = serial.serial_for_url(...)
  except AttributeError:
      s = serial.Serial(...)
  </code></pre>
  
  <p>Not sure if this helps though...</p>