Giter Site home page Giter Site logo

qtelnet's Introduction

QTelnet

A telnet client using Qt5 framework. Originally created for Siragga MUD client (not public).

This is a very basic telnet client, unblocking and easy to use. Takes care of telnet protocol leaving the clean data to the developer.

To create a telnet client you only need QTelnet.h and QTelnet.cpp files and to include in .pro file the network library:
QT += core guinetwork

The rest of files/classes, QCmdWidget and QTelnetTester, where used by me to develop it, but you can look at them to understand how to use the library.

Anyway, it is as easy as using three functions and catch other two:

Functions

  • connectToHost(const QString &host, quint16 port)
    To connect to a host via IP or host name
  • disconnectFromHost()
    close connection.
  • sendData(const QByteArray &ba)
    send data (commands, if you prefer) to the telnet server. This funcion requires a QByteArray in his first parameter because you send bytes to server, not text. No, it's not the same: Text could be in Unicode. So, you need to decode your text before sending it.

Signals

  • newData(const char*,int)
    This is invoked when new data comes from server. Beware, if you parse incoming data through code, remember that the text NEVER comes at once. Meaning, any text form server could come in an unknown number of newData calls. So, you'll need to buffer it until all comes. Yes, it's not easy to know if "all" has come. Sadly, I cannot hep you at this because it's up to the server if sends any "prompt" or not.
  • stateChanged(QAbstractSocket::SocketState)
    Catch this signal to know socket state changes.

qtelnet's People

Contributors

silderan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qtelnet's Issues

telnet.canReadLine())

in serial comunication is posible this while (m_serialPort.canReadLine()), is posible in this program?

choose network interface

Hi,
I would like to know if i can choose the network interface i want to use for telnet connection ?

readline

Hi,
Is there a way to use "readLine()" function ? I tried to connect "readyRead" signal to a slot with readLine function, but does not work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.