Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #5445
| From | Daniel Pitts <newsgroup.nospam@virtualinfinity.net> |
|---|---|
| Newsgroups | comp.programming |
| Subject | Re: Sending Telnet “DON'T” or “WON'T” after having a successful a “DO” or “WILL”. |
| References | <4wQ6x.38225$yI2.34601@fx19.iad> <555C18D1.5070005@hotmail.com> |
| Message-ID | <h%07x.27117$Py6.14530@fx17.iad> (permalink) |
| Date | 2015-05-20 07:38 -0700 |
On 5/19/15 10:17 PM, Michael Griffin wrote: > On 5/19/2015 7:25 PM, Daniel Pitts wrote: >> I apologize if this is off topic, not quite sure where else to ask. >> >> I'm implementing my own Telnet library in Java (just because). I'm >> wondering if my library should allow sending a "WONT" or "DONT" that was >> otherwise unsolicited. I'm also wondering if my library should reply to >> unsolicited "DONT" or "WONT" requests with the "WONT" or "DONT" reply >> respectively. The RFC isn't quite clear on that part of the contract. >> >> All of this is assuming that I've already sent a DO and got a WILL, or >> visa versa. >> >> >> Thanks, >> Daniel. > > Well usually the server is the one that initiates the negotiation. My library's first use is actually a server, but Telnet is fully symmetric at the protocol layer, so "usual" isn't what I was thinking of. > > If it's a client, then it should usually respond back with what the > server is querying like BINARY, ECHO, NAWS etc.. But of course if an > expected response is not received by the client, it is allowed to ask > the server for it's preference. Unsolicited response are allowed, and > can either be responded to, or ignored. > > You want to be aware of possible loops where responses keep exchanging > back and forth between the server and client well after they been answered. > > Michael > telnet://htc.zapto.org > I'm thinking in particular after having said "IAC WILL <FOO>", and receiving a "IAC DO <FOO>", can I later sao "IAC WONT <FOO>" to stop FOOing? And when I do that, will I receive an acknowledgement? Another way to ask this is: If I received a "IAC DO <FOO>" after a "IAC WILL <FOO>", the other side has the ability to change its mind "IAC DON'T <FOO>". When they do that, should I reply with "IAC WON'T <FOO>", or just silently accept the new state of affairs? I think I realized the answer: If I receive a command that changes my state, then I should acknowledge with the new state. Defensive programming says I shouldn't expect an acknowledgement, but handle one cleanly. If I disable an option changes my handling of the data stream, I shouldn't disable the processing until the byte after the response of IAC DON'T/WON'T.
Back to comp.programming | Previous | Next — Previous in thread | Find similar | Unroll thread
Sending Telnet “DON'T” or “WON'T” after having a successful a “DO” or “WILL”. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2015-05-19 17:25 -0700
Re: Sending Telnet “DON'T” or “WON'T” after having a successful a “DO” or “WILL”. Michael Griffin <mrmisticismo@hotmail.com> - 2015-05-20 00:17 -0500
Re: Sending Telnet “DON'T” or “WON'T” after having a successful a “DO” or “WILL”. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2015-05-20 07:38 -0700
csiph-web