Force telnet client into character mode
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an application where I accept a socket connection from a telnet client and put up a simple, keyboard driven character GUI. The telnet client, at least on Linux, defaults into line-at-a-time mode, so I always have to do ^]mode char manually. A skim of the relevant RFCs suggests that if my application simply sent the characters IAC DONT LINEMODE (\377\376\042) as soon as the client connects, the client should be forced into character mode. However, it doesn't make any difference. What's the simplest bit of code that would do the job?