Re: network programming in c
- From: mwojcik@xxxxxxxxxxx (Michael Wojcik)
- Date: 11 Oct 2005 21:08:59 GMT
In article <NNSdnTTy2eNudNfeRVnyhA@xxxxxxxxx>, moi <avk@localhost> writes:
> dajava wrote:
> >
> > Say, there is a chess playing server. Choose any one. Which protocol
> > does it use?
> > I thought that kind of server used telnet. But a professional programer
> > told me his own server useed tcp/ip.
>
> The chess and go -servers that I know (Fics and derivatives, for short)
> have a listening port open (5000, IIRC for Fics). After accept() they
> communicate with their client with CRLF-delimited ASCII-strings.
Of course, this is very common with application protocols designed
for TCP/IP, though it's a cultural thing - there's nothing inherent
in TCP/IP that makes it more suited for text-based application
protocols (or ASCII, for that matter, though since eg DNS uses ASCII
there's an ASCII bias in practice). FTP, SMTP, HTTP, and so on use
plain-text commands.
Ironically, Telnet itself doesn't use plain-text commands.
> That allows people to connect to the server, using /usr/bin/telnet as
> their client program.
> The server recognises but ignores most (all but one ...) of the telnet
> options. (which is allowed by the RFC, IIRC)
Typical Telnet clients by default don't attempt to initiate Telnet
option negotiation when connecting to a port other than 23, which is
why you can use them to drive SMTP, HTTP, POP3, NNTP, and so forth.
(I use a Telnet client relatively frequently to do POP3 and NNTP,
when I want to quickly check something on the server or perform some
administrative action that's not convenient through a conventional
client.)
A Telnet implementation is always free to refuse to enable an option,
AFAIK, so it should be legal for one to support no Telnet options at
all, just NVT mode. (It can't actually "ignore" them - it has to
send DONT or WONT - but it can reject them.)
> That is why the clients are sometimes called 'telnet clients', which is
> confusing. To say the least.
That may indeed be why the OP believed the server used Telnet. And
for all I know, the server in question might have an actual Telnet
implementation; that'd be an odd choice, IMO, if it always drives a
chess-game application, but it would provide a standard way to handle
things like negotiating terminal type.
--
Michael Wojcik michael.wojcik@xxxxxxxxxxxxxx
Some there are, brave, high-souled fellows, who could borrow the world to
play at ball, and never feel the responsibility, whereas others are uneasy
and not themselves with a single shilling that does not belong to them.
-- Arthur Ransome
.
- References:
- Re: network programming in c
- From: Jonathan Bartlett
- Re: network programming in c
- From: Michael Wojcik
- Re: network programming in c
- From: dajava
- Re: network programming in c
- From: moi
- Re: network programming in c
- Prev by Date: Re: Progamming language for hackers?
- Next by Date: Re: How to solve windows getting distorted after pushing up DPI settings
- Previous by thread: Re: network programming in c
- Next by thread: Re: network programming in c
- Index(es):
Relevant Pages
|