Board index » delphi » multi-node telnet server

multi-node telnet server

Hello.  I'm having trouble using the idTCPServer component (from Indy.  I'm
using Delphi 6.)

The help files doesn't give me the answers I seek, so if anyone can perhaps
help me, or point me to information or the internet it would really be
appreciated.  The sample code that comes with Delphi tells me

 with AThread.Connection do
  begin
  WriteLn('Hello from Basic Indy Server server.');
  //Disconnect;
  end;

How do I discern between different connections?  A friend and I want to
write a telnet-based game (i.e a MUD), which is multi-node, i.e more than
one connection.  I know that once a client connects, Winsock creats another
socket for that connection - but how do I "talk" directly to that connection
with Delphi?  I.e how do I talk with multiple connections concurrently?
(how do I adress them?)  (this is one question, I'm just repeating it
differently for clarification)

Also, where would I go about entering the error-handling code?  I've
actually wrote quite a lot of the winsock-source in Visual C++ already, but
are going to do it in Delphi now, and am just uncertain where error-handling
takes place.

If anyone, just in general, has any tips on writing this telnet-based game
it would be appreciated.  Perhaps your insight will save me hours of
hardship

Thanks for the help
Appreciated
Rogmonoth

 

Re:multi-node telnet server


Quote
Rogmonoth wrote in message <3c1bc99...@news1.mweb.co.za>...
>Hello.  I'm having trouble using the idTCPServer component (from Indy.
I'm
>using Delphi 6.)

>The help files doesn't give me the answers I seek, so if anyone can
perhaps
>help me, or point me to information or the internet it would really be
>appreciated.  The sample code that comes with Delphi tells me

> with AThread.Connection do
>  begin
>  WriteLn('Hello from Basic Indy Server server.');
>  //Disconnect;
>  end;

>How do I discern between different connections?  A friend and I want to
>write a telnet-based game (i.e a MUD), which is multi-node, i.e more than
>one connection.  I know that once a client connects, Winsock creats
another
>socket for that connection - but how do I "talk" directly to that
connection
>with Delphi?  I.e how do I talk with multiple connections concurrently?
>(how do I adress them?)  (this is one question, I'm just repeating it
>differently for clarification)

>Also, where would I go about entering the error-handling code?  I've
>actually wrote quite a lot of the winsock-source in Visual C++ already,
but
>are going to do it in Delphi now, and am just uncertain where
error-handling
>takes place.

I don't know the first thing about the Indy components, but
idTCPServer sounds sufficiently like TServerSocket that I
feel confident enough to hazard a few guesses.

The first guess: Connection is an array property. Because
servers _can_ have multiple connections open, so you need
to specify some key to disambiguate the client.

The second guess: The socket component has a bunch of
event properties, and one of them is an error event.

Both these things probably feature prominently in the help
files that are undoubtedly supplied with the Indy suite.
Do they? Did you check? Did you read them in the first
place? All of them? (Optionally: Why not? and Why are you
here instead of reading the help files first?)

Groetjes,
Maarten Wiltink

Other Threads