Click here to Skip to main content
Licence GPL3
First Posted 24 Oct 2007
Views 28,010
Downloads 1,566
Bookmarked 24 times

MFC Telnet Application

By | 8 Nov 2007 | Article
The article demonstrates an MFC GUI Telnet application with server capabilities for incoming connections support.

Introduction

I've developed a Telnet application for implementing manual connection and data sending capabilities to Internet servers. You may use it for text mode Internet protocols (SMTP, POP, HTTP, WHOIS etc.) for sending, retrieving emails, whois queries, and so on. The application also allows opening ports on local computers for incoming connections.

Background

You need an understanding of Internet protocols to be able to connect to servers and implement commands. Have a look at the corresponding RFCs available online.

Using the code

Click the first red button on the toolbar (CTRL+N) to connect to an Internet server on a particular port.

connect to server

The server address combo box is filled with predefined addresses, loaded from a hosts file present in the same directory as the Telnet application. After being connected to the server, you may send text messages to it. Click the INS key button in the text view, type in the command you want to send (if it won't fit in one single line, press ENTER to move the caret to the next line; also, in the multi-line text messages, end the last string you typed with an ENTER, and press ESC to send it), then press the ESC key to send the data you typed in. Wait for the response from the server.

This one provides an example output of a whois query on port 43:

whois query

whois query

In case of getting disconnected, press CTRL+R to redial connection to that server.

To listen on a particular port, press CTRL+L and enter the port you want to open:

listen on port

Try to open port 80 and enter http://127.0.0.1 in your IE browser while disconnected from the Internet. You will get a message similar to that appearing in the text view. You may send a reply to the IE browser with the same mode as I described before (INS, type the text message, ENTER, ESC).

IE connection

The client part is implemented with the CClientDoc, CClientView pair and the server part with the CServerDoc, CServerView pair.

There is one additional class in the project I developed:

  • Socket
  • It actually wraps WinSock functions for creating a socket, connecting to the server, sending and receiving data, and listening on a port. Have a look at the socket.h header.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

About the Author

Chesnokov Yuriy

Engineer

Russian Federation Russian Federation

Member

Former Cambridge University postdoc (http://www-ucc-old.ch.cam.ac.uk/research/yc274-research.html), Department of Chemistry, Unilever Centre for Molecular Informatics, where I worked on the problem of complexity analysis of cardiac data.
 
As a subsidiary result we achieved 1st place in the annual PhysioNet/Computers in Cardiology Challenge 2006: QT Interval Measurement (http://physionet.org/challenge/2006/)
 
My research intrests are: digital signal processing in medicine, image and video processing, pattern recognition, AI, computer vision.
 
My recent publications are:
 
Complexity and spectral analysis of the heart rate variability dynamics for distant prediction of paroxysmal atrial fibrillation with artificial intelligence methods. Artificial Intelligence in Medicine. 2008. V43/2. PP. 151-165 (http://dx.doi.org/10.1016/j.artmed.2008.03.009)
 
Face Detection C++ Library with Skin and Motion Analysis. Biometrics AIA 2007 TTS. 22 November 2007, Moscow, Russia. (http://www.dancom.ru/rus/AIA/2007TTS/ProgramAIA2007TTS.html)
 
Screening Patients with Paroxysmal Atrial Fibrillation (PAF) from Non-PAF Heart Rhythm Using HRV Data Analysis. Computers in Cardiology 2007. V. 34. PP. 459–463 (http://www.cinc.org/archives/2007/pdf/0459.pdf)
 
Distant Prediction of Paroxysmal Atrial Fibrillation Using HRV Data Analysis. Computers in Cardiology 2007. V. 34. PP. 455-459 (http://www.cinc.org/archives/2007/pdf/0455.pdf)
 
Individually Adaptable Automatic QT Detector. Computers in Cardiology 2006. V. 33. PP. 337-341 http://www.cinc.org/archives/2006/pdf/0337.pdf)

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralERROR - Your telnet client rejected our request to use char-at-a-time mode! PinmemberMember 223391517:54 12 Oct '09  
AnswerRe: ERROR - Your telnet client rejected our request to use char-at-a-time mode! PinmemberChesnokov Yuriy19:09 12 Oct '09  
QuestionHow to get whois query output? PinmemberPriya_Sundar22:30 30 Oct '08  
AnswerRe: How to get whois query output? PinmvpChesnokov Yuriy1:13 31 Oct '08  
QuestionHow to add the source code in project? - No .dsp or .dsw files. PinmemberPriya_Sundar20:06 29 Oct '08  
AnswerRe: How to add the source code in project? - No .dsp or .dsw files. PinmvpChesnokov Yuriy20:22 29 Oct '08  
GeneralRe: How to add the source code in project? - No .dsp or .dsw files. PinmemberPriya_Sundar18:42 30 Oct '08  
Generalgood work. can u send to me.full source plz.. Pinmemberox1111@paran.com18:11 25 May '08  
AnswerRe: good work. can u send to me.full source plz.. it's in src.zip PinmvpChesnokov Yuriy20:57 26 May '08  
it is full in src.zip
 
chesnokov

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
Web02 | 2.5.120604.1 | Last Updated 8 Nov 2007
Article Copyright 2007 by Chesnokov Yuriy
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid