【 在 IO (蓝馨@50%--大郁闷:() 的大作中提到: 】
: 谢谢谢谢!!!:)
你把 telnet_init 函数改成这个看看?
static void
telnet_init()
{
static char svr[] = {
IAC, DO, TELOPT_TTYPE,
IAC, SB, TELOPT_TTYPE, TELQUAL_SEND, IAC, SE,
IAC, WILL, TELOPT_ECHO,
IAC, WILL, TELOPT_SGA
};
int n, len;
char *cmd;
int rset;
struct timeval to;
char buf[64];
/* --------------------------------------------------- */
/* init telnet protocol */
/* --------------------------------------------------- */
cmd = svr;
for (n = 0; n < 4; n++)
{
len = (n == 1 ? 6 : 3);
send(0, cmd, len, 0);
cmd += len;
}
}
--
FROM 166.111.165.168