Board index » delphi » Telnet Server "Shutting Down" message

Telnet Server "Shutting Down" message

Any one have any tips for sending "Shutting Down in 2 minutes" to all
currently connected telnet clients

Thanks

 

Re:Telnet Server "Shutting Down" message


what's the problem?
what telnetserver-component do you use?

--

Bas Gooijen

Quote
"Richard Owen" <metrixsoftw...@hotmail.com> wrote in message

news:3d8e6683$1@newsgroups.borland.com...
Quote
> Any one have any tips for sending "Shutting Down in 2 minutes" to all
> currently connected telnet clients

> Thanks

Re:Telnet Server "Shutting Down" message


I am using the TidTelnetServer... Indy 9.0

What I am aiming for is too "broadcast" a message to all connected clients
(I am using the built in Telnet client of Windows XP)...
For example: when a user logs in I would like to send too all other
connected users "George has logged in"
My worry is that each Telnet connection is in a thread and I need to get
each thread to do a Connection.Writeln('George has connected');

Is there some helper function that can do this?
Do I need to maintain an external TThreadList of connections or is there
already one available?
What threading issues do I have to worry about?

Thanks

Richard

NOTE: the actual use is for a telnet based debug server... One can log into
the server and receive debug strings, and I would like multiple clients to
log in and all to receive the debug output (it's for a TServerApplication
running in a remote location)

Quote
"Bas Gooijen" <bas_gooi...@yahoo.com> wrote in message

news:3d8f372b@newsgroups.borland.com...
Quote
> what's the problem?
> what telnetserver-component do you use?

> --

> Bas Gooijen

> "Richard Owen" <metrixsoftw...@hotmail.com> wrote in message
> news:3d8e6683$1@newsgroups.borland.com...
> > Any one have any tips for sending "Shutting Down in 2 minutes" to all
> > currently connected telnet clients

> > Thanks

Re:Telnet Server "Shutting Down" message


Quote
Richard Owen <metrixsoftw...@hotmail.com> wrote in message news:3d8fb6d5$1@newsgroups.borland.com...
> I am using the TidTelnetServer... Indy 9.0

> What I am aiming for is too "broadcast" a message to all connected clients
> (I am using the built in Telnet client of Windows XP)...
> For example: when a user logs in I would like to send too all other
> connected users "George has logged in"
> My worry is that each Telnet connection is in a thread and I need to get
> each thread to do a Connection.Writeln('George has connected');

> Is there some helper function that can do this?
> Do I need to maintain an external TThreadList of connections or is there
> already one available?
> What threading issues do I have to worry about?

I seem to remember that there is a 'bindings' property that allows you to
iterate the connections.  I am fairly sure, (that's code for 'I haven't tried
it myself'), that there should be no inherent problem with a write call from
the thread that created the TidTCPserver.  The snag is that the individual
connection threads can also asynchronously write - presumably they write
telnet prompts, echo chars. from the clients and send data in response to
commands.  I suggest a critical section around all these write calls,  CS's
that you should acquire in the parent thread before issuing each broadcast
write.  Also, there is the problem of how you/Indy maintain your
connections.  The bindings list may change while you iterate it as users log
in & disconnect.  You have to take care here, and it may be that you
cannot avoid an occasional AV or other error during this process - trap &
dump.

Rgds,
Martin

Other Threads