pbd22 wrote:
Telnet (AFAIK) isn't a whole lot more than a terminal emulator stuck
onto the client side of a TCP connection. And you seem to be focused on
the server side, so we can leave aside terminal control codes.
telnet command( "open" ) >.net parser ( "something new").
I mean, a telnet command can be turned into a string, right?
The characters typed on the client end get sent over the TCP connection
pretty much literally as ASCII, yes.
So, if somebody remotely telnets to my computer and then
types some commands, I should be able to use TcpListener
to catch those commands and manipulate them, right?
Yes. Create a TCP server program which listens on port 23.
The point where I am having problems is reading the bytestream
and translating that into a string.
Does anybody out there have some initial ideas?
For very basic initial support, read and buffer (in a List<bytefor
example) each byte one at a time until you see a line-feed (byte value
10), then convert it into a string using Encoding.ASCII, or maybe by
manually casting the byte values into chars and stuffing into a
StringBuilder.
-- Barry
--
http://barrkel.blogspot.com/