Board index » delphi » beginner's telnet server problems (INDY)

beginner's telnet server problems (INDY)

Quote
Tomas Michalk <micha...@proca.cz> wrote in message news:3B31A588.64B1FAFE@proca.cz...
> Hi,

> first, I never did anything with sockets before ...

> Now I need to write a telnet server so I started playing with INDY and
> have a little trouble already <g>

> In an OnConnect event my telnet server thread connects to database and
> disconnects when client disconnects. In between those events it should
> do various database stuff based on client's commands. I came to the
> point where this basically works - using AThread.Connection.WaitFor in
> OnExecute handler of TidTelnetServer I am able to receive the commands
> and react. The only problem I have is that when typing my commands in
> any telnet client (Windows terminal, INDY TelnetClient demo), I cannot
> see what I am typing (except for username and password). It simply
> doesn't display the characters, but it displays everything I send to the

Turn on local echo on client.  Either that or send back all incoming characters in your
server.  I have a boolean on the server env. block 'echoON', which is off by default, but
can be turned on/off by the users with a command, (unsuprisingly, 'echo [on|off]').

Rgds,
Martin

 

Re:beginner's telnet server problems (INDY)


Hi,

first, I never did anything with sockets before ...

Now I need to write a telnet server so I started playing with INDY and
have a little trouble already <g>

In an OnConnect event my telnet server thread connects to database and
disconnects when client disconnects. In between those events it should
do various database stuff based on client's commands. I came to the
point where this basically works - using AThread.Connection.WaitFor in
OnExecute handler of TidTelnetServer I am able to receive the commands
and react. The only problem I have is that when typing my commands in
any telnet client (Windows terminal, INDY TelnetClient demo), I cannot
see what I am typing (except for username and password). It simply
doesn't display the characters, but it displays everything I send to the
client from server.

I have already searched the archives and haven't found a solution to
this. I am sure I am making some silly mistake.

I would really appreciate if someone tells me what do I do wrong/what
should I do. Maybe I haven't explained what the problem is very
accurately - just let me know and I will try again.

TIA and best regards,
Tom

=================================

  Tomas Michalik
  ProCA, s. r. o.
  V Luzich 818, Praha 4
  Czech Republic

  e-mail: micha...@proca.cz
  tel: +420 2 67283446

Re:beginner's telnet server problems (INDY)


Quote
"Tomas Michalk" <micha...@proca.cz> wrote in message

news:3B31A588.64B1FAFE@proca.cz...
[Snip]

Quote
> any telnet client (Windows terminal, INDY TelnetClient demo), I cannot
> see what I am typing (except for username and password). It simply
> doesn't display the characters, but it displays everything I send to the
> client from server.

You need to enhance the TelnetClient demo to do local echo.
Just create a checkbox, and test for the checked value in the procedure
TfrmTelnetDemo.Memo1Keypress in line 69. (mainform.pas)
If local echo is true, it must not execute the Key:=#0 statement in line 75.
(mainform.pas)
this statement causes the key that was pressed to be 'ignored'.

As for the windows terminal you have to turn on local echo..

Of course you could also on the other side (the server) make certain that
any information that is sent to the TelnetServer is sent back to the client.
Because this is fairly standard, the telnetclient demo, and the windows
telnet client have local echo by default off (or not implemented as with the
demo).

Quote
> I have already searched the archives and haven't found a solution to
> this. I am sure I am making some silly mistake.

Nothing silly here, it's hard to look for something if you don't know what
it's being called..

[snip]

Regards,
Marco..

Re:beginner's telnet server problems (INDY)


Why not take a look at the Indy 8.1 beta - it has a feature called
CommandHandlers which might make this a little easier to code and manage.

As for the telnet issue  - this is normal. You could replace the
TelnetServer with a TCPServer...

Quote
"Tomas Michalk" <micha...@proca.cz> wrote in message

news:3B31A588.64B1FAFE@proca.cz...
Quote
> Hi,

> first, I never did anything with sockets before ...

> Now I need to write a telnet server so I started playing with INDY and
> have a little trouble already <g>

> In an OnConnect event my telnet server thread connects to database and
> disconnects when client disconnects. In between those events it should
> do various database stuff based on client's commands. I came to the
> point where this basically works - using AThread.Connection.WaitFor in
> OnExecute handler of TidTelnetServer I am able to receive the commands
> and react. The only problem I have is that when typing my commands in
> any telnet client (Windows terminal, INDY TelnetClient demo), I cannot
> see what I am typing (except for username and password). It simply
> doesn't display the characters, but it displays everything I send to the
> client from server.

> I have already searched the archives and haven't found a solution to
> this. I am sure I am making some silly mistake.

> I would really appreciate if someone tells me what do I do wrong/what
> should I do. Maybe I haven't explained what the problem is very
> accurately - just let me know and I will try again.

> TIA and best regards,
> Tom

> =================================

>   Tomas Michalik
>   ProCA, s. r. o.
>   V Luzich 818, Praha 4
>   Czech Republic

>   e-mail: micha...@proca.cz
>   tel: +420 2 67283446

Other Threads