Important alert: (current site time 7/15/2013 6:36:25 PM EDT)
 

winzip icon

Telnet Client By Ibrar Ahmad

Email
Submitted on: 12/24/2000 2:07:05 PM
By: Ibrar Ahmed  
Level: Advanced
User Rating: By 10 Users
Compatibility: Microsoft Visual C++
Views: 46023
(About the author)
 
     Introduction This is a telnet console application that implements the Telnet client protocol (rfc854.) I have run it on VC6, NT4.0 SP3 Telnet 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 CSocketDx Class is used to establish TCP connection. It has 3 functions CSocketDx(char *,int); ~CSocketDx(); int Create(); int Connect(); SOCKET TelnetConnect(); CSocketRx CSocketRx Class is used to Receive data. It has only one thread. CSocketRx(); CSocketRx(SOCKET,HANDLE&); virtual ~CSocketRx(); static DWORD RdTh(CSocketRx *); CSocketTx CSocketTx Class is used to Send data. It has only one thread. CSocketTx(SOCKET,HANDLE&); virtual ~CSocketTx(); static DWORD SendTh(CSocketTx*); CProtocolRx CProtocolRx Class is used Implement 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); Platforms I have run it on VC6, NT4.0 SP3; I did not test it on 95 and VC5 Limitations Cannot handle arrow keys

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

10/2/2001 6:52:57 AMFlavio Tartarini

Thank you very much Ibrar!
(If this comment was disrespectful, please report it.)

 
3/29/2002 8:35:47 AMmanju

hello .
when i tried connecting your client to a telnet server('good tech' server) I'm getting junk values along with the data sent by the server. Can you please please tell/ suggest what the problem is ? i tried connecting to the server using other clients(dtelnet) and found it was working properly.
can you tell me what i should do to correct the problem in ur client.
looking forward to your reply.
thank you
manju
manju_shan@yahoo.com
(If this comment was disrespectful, please report it.)

 
5/14/2003 7:24:47 AM

Hello Ibrar,

I have made changes in your code using C, I am unable to receive the login prompt of the Telnet Server.

What should I do incase converted to C.


(If this comment was disrespectful, please report it.)

 
12/9/2009 1:11:54 AMYounis AL-Hussaini

Thank you Ibrar
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.