This is the mail archive of the
cygwin
mailing list for the Cygwin project.
How to write telnet server like program for serial port?
- From: "Siegfried Heintze" <siegfried at heintze dot com>
- To: <cygwin at cygwin dot com>
- Date: Fri, 1 Oct 2004 16:41:09 -0600
- Subject: How to write telnet server like program for serial port?
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/