You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by cthulhu <ja...@eml.cc> on 2003/05/28 02:41:59 UTC
Invalid Option Code: 91 (org.apache.commons.net.telnet.SimpleOptionHandler)
Hi,
I'm absolutely new to telnet, I have readen the RFC and more or less
understood it.
I'm playing around with a MUD client and want to answer the server that
i can handle MXP.
From some docs I'have found the telnet negotiation should work in the
following way:
(Sent from server to client) <IAC><WILL><MXP>
(Sent from client to server) <IAC><DO><MXP>
(Sent from server to client) <IAC><SB><MXP><IAC><SE>
Following this sequence the server can then start sending MXP tags.
If I understood rightly how all this works I have to register a
OptionHandler for the option MXP wich int value is 91
SimpleOptionHandler mxpopt = new SimpleOptionHandler(91, false, false,
false, true); // not sure about the flags but that's not the point,
or not?
...
client.addOptionHandler(mxpopt);
...
Now, when I run the program a InvalidTelnetOtionException is thrown
telling me that 91 is an invalid option code...
What I'm doing wrong? Does that mean that the server doesent has any MXP
otpion(but it should, I can see MXP working with another client)? Or I
just got everything the wrong way?
Thanks in advance for any help.
Marco
Re: Invalid Option Code: 91 (org.apache.commons.net.telnet.SimpleOptionHandler)
Posted by cthulhu <ja...@eml.cc>.
Well, i found a hack who solves it.
I changed
public static int NEW_ENVIRONMENT_VARIABLES = 39;
to
public static int NEW_ENVIRONMENT_VARIABLES = 100;
in the TelnetOption class and now it works :)
Shouldn't be there a better way to handle this?
Marco
cthulhu wrote:
> Hi,
> I'm absolutely new to telnet, I have readen the RFC and more or less
> understood it.
> I'm playing around with a MUD client and want to answer the server
> that i can handle MXP.
> From some docs I'have found the telnet negotiation should work in the
> following way:
>
> (Sent from server to client) <IAC><WILL><MXP>
> (Sent from client to server) <IAC><DO><MXP>
> (Sent from server to client) <IAC><SB><MXP><IAC><SE> Following
> this sequence the server can then start sending MXP tags.
>
> If I understood rightly how all this works I have to register a
> OptionHandler for the option MXP wich int value is 91
>
> SimpleOptionHandler mxpopt = new SimpleOptionHandler(91, false, false,
> false, true); // not sure about the flags but that's not the
> point, or not?
> ...
> client.addOptionHandler(mxpopt);
> ...
>
> Now, when I run the program a InvalidTelnetOtionException is thrown
> telling me that 91 is an invalid option code...
> What I'm doing wrong? Does that mean that the server doesent has any
> MXP otpion(but it should, I can see MXP working with another client)?
> Or I just got everything the wrong way?
>
> Thanks in advance for any help.
>
> Marco
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>