Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Siegfried Heintze" To: Subject: How to write telnet server like program for serial port? Date: Fri, 1 Oct 2004 16:41:09 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In-Reply-To: Message-Id: <200410011640796.SM01220@fasolt> X-IsSubscribed: yes I need to write a program similar to a telnet server. A telnet server asynchronously reads data from a socket and writes it to a sub-process, and asynchronously reads data from the subprocess and writes to a socket. My program needs to replace the subprocess with a serial port. The telnet server cannot anticipate when data will arrive from the socket. Neither can it anticipate when data will arrive from the subprocess. How can I write a similar OS vendor neutral program using Cygwin C++, except, instead reading and writing to a process, I read and write to serial port? Can I do this with a single thread? How do I read and write to a serial port? Can anyone point me to some sample code for serial port I/O? I suppose I can look at the source for telnet -- it probably uses the select function. Thanks, Siegfried -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/