Click here to Skip to main content
13,864,351 members
Click here to Skip to main content
Add your own
alternative version


61 bookmarked
Posted 24 Jan 2001

Telnet Console Application

, 31 Jul 2001
Rate this:
Please Sign up or sign in to vote.
A console based telnet application.


This is a telnet console application that implements the Telnet client protocol in rfc854. I have run it on VC6, NT4.0 SP3. I did not test it on 95 and VC5.


The purpose of the TELNET Protocol is to provide a fairly general, bi-directional, eight-bit byte oriented communications facility. Its primary goal is to allow a standard method of interfacing terminal devices and terminal-oriented processes to each other. It is envisioned that the protocol may also be used for terminal-terminal communication ("linking") and process-process communication (distributed computation).

General Considerations

A TELNET connection is a Transmission Control Protocol (TCP) connection used to transmit data with interspersed TELNET control information. The TELNET protocol is built upon three main ideas: first, the concept of a "Network Virtual Terminal"; second, the principle of negotiated options; and third, a symmetric view of terminals and processes.

When a TELNET connection is first established, each end is assumed to originate and terminate at a "Network Virtual Terminal", or NVT. An NVT is an imaginary device which provides a standard, network-wide, intermediate representation of a canonical terminal. This eliminates the need for "server" and "user" hosts to keep information about the characteristics of each other's terminals and terminal handling conventions. All hosts, both user and server, map their local device characteristics and conventions so as to appear to be dealing with an NVT over the network, and each can assume a similar mapping by the other party. The NVT is intended to strike a balance between being overly restricted (not providing hosts a rich enough vocabulary for mapping into their local character sets), and being overly inclusive (penalizing users with modest terminals).

This project has five main classes.


CSocketDx class is used to establish TCP connection. It has 3 functions:

CSocketDx(char *,int);
int Create();
int Connect();
SOCKET TelnetConnect();


CSocketRx class is used to receive data. It has only one thread.

virtual ~CSocketRx();
static DWORD RdTh(CSocketRx *);


CSocketTx class is used to send data. It has only one thread.

virtual ~CSocketTx();
static DWORD SendTh(CSocketTx*);


CProtocolRx class is used to implement the Telnet protocol.

inline void yesreply(SOCKET server, _verb verb,_option option);
inline void noreply(SOCKET server, _verb verb,_option option);
inline void askfor(SOCKET server, _verb verb,_option option);
void TelentProtcol(SOCKET server,unsigned char code);


I have run it on VC6, NT4.0 SP3, I did not test it on 95 and VC5.


Cannot handle arrow keys.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Ibrar Ahmad
Web Developer
Pakistan Pakistan
Master of Computer Science
1). C++
2). C
3). Network Programming...
Socket,Pipe,Protocol Implemntation
4). hardware interfaceing
5). Emabeded programming in C51...Etc
(for 8051,PIC,C166 Processores)

You may also be interested in...


Comments and Discussions

QuestionThe download URL is invalid Pin
MasterFan15-Jul-13 20:00
memberMasterFan15-Jul-13 20:00 
Questionerror while building application Pin
smaranika8-Mar-11 20:32
membersmaranika8-Mar-11 20:32 
GeneralMy vote of 5 Pin
dkgversion6-Dec-10 19:34
memberdkgversion6-Dec-10 19:34 
NewsIt works with win 7 Pin
Dr.Luiji18-Feb-10 5:29
professionalDr.Luiji18-Feb-10 5:29 
Questionopen source software ? license? Pin
johnlol18-Jan-10 10:43
memberjohnlol18-Jan-10 10:43 
GeneralThanks Pin
auralius manurung28-Oct-08 23:43
memberauralius manurung28-Oct-08 23:43 
Questionhow to change this program to send commands via file handle and store output into a file??? Pin
RAJKUMARV21-Apr-08 2:42
memberRAJKUMARV21-Apr-08 2:42 
QuestionHow to off ECHO on client window? Pin
kumardeepak4-Feb-07 23:15
memberkumardeepak4-Feb-07 23:15 
AnswerRe: How to off ECHO on client window? Pin
723Alex14-Mar-07 17:30
member723Alex14-Mar-07 17:30 
QuestionHow could I send arrow keys? Pin
eghost30-Jan-07 23:53
membereghost30-Jan-07 23:53 
AnswerRe: How could I send arrow keys? Pin
eghost31-Jan-07 15:03
membereghost31-Jan-07 15:03 
GeneralRe: How could I send arrow keys? Pin
eghost1-Feb-07 22:16
membereghost1-Feb-07 22:16 
QuestionHow to disable Telnet-Prompt? Pin
mephistho17-Jul-06 23:33
membermephistho17-Jul-06 23:33 
AnswerRe: How to disable Telnet-Prompt? Pin
kumardeepak4-Feb-07 23:17
memberkumardeepak4-Feb-07 23:17 
GeneralRe: How to disable Telnet-Prompt? Pin
mephistho5-Feb-07 22:36
membermephistho5-Feb-07 22:36 
GeneralRe: How to disable Telnet-Prompt? Pin
kumardeepak7-Feb-07 0:52
memberkumardeepak7-Feb-07 0:52 
GeneralRe: How to disable Telnet-Prompt? Pin
wnagenbo12-Apr-07 5:02
memberwnagenbo12-Apr-07 5:02 
GeneralAbout SSH Pin
JZM21-Dec-05 15:10
memberJZM21-Dec-05 15:10 
GeneralRe: About SSH Pin
benjamin232-Apr-08 5:14
memberbenjamin232-Apr-08 5:14 
GeneralCSI control sequences Pin
ssh3313-Dec-04 6:11
memberssh3313-Dec-04 6:11 
GeneralTelnet Color Format Pin
cnalpine26-Dec-02 21:06
membercnalpine26-Dec-02 21:06 
GeneralRe: Telnet Color Format Pin
HughJampton25-Feb-05 11:57
memberHughJampton25-Feb-05 11:57 
GeneralConvert it to Single Dialog Pin
Amjad W. Hawash18-Mar-02 3:28
memberAmjad W. Hawash18-Mar-02 3:28 
QuestionHow to put your login and password in your code? Pin
rena8-Nov-01 7:50
memberrena8-Nov-01 7:50 
AnswerRe: How to put your login and password in your code? Pin
markw_socal30-Nov-01 8:22
membermarkw_socal30-Nov-01 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06 | 2.8.190214.1 | Last Updated 1 Aug 2001
Article Copyright 2001 by Ibrar Ahmad
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid