Hpux telnet 使用套接字 [英] Hpux telnet using socket

查看:38
本文介绍了Hpux telnet 使用套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

oSun 操作系统、UTS、AIX 等.但是,当在另一端使用 HP UX 运行相同的程序时,我们会无法接收来自 HP UX 框 (B.11.31 O/S) 的响应.

o Sun OS, UTS, AIX etc. But, when the same program is run with HP UX on the other end, we are unable to receive the response from the HP UX box (B.11.31 O/S).

sSocket = socket(AF_INET,SOCK_STREAM,0); 
connect(sSocket,(struct sockaddr *)&sin,sizeof(sin); 
ierr = read(sSocket,szBuffer,BUF_LEN-1); 

当读取被调用时,我们会收到这样的垃圾消息

When the read is called, we get junk messages like this

Message received :ÿý$ 
Message received :ÿýÿþÿý 
Message received :ÿü!ÿû 

此代码适用于我之前所说的所有其他操作系统.能有人解释为什么会这样.注意:我们可以使用 telnet 手动登录 HP Box.

This code was working for all the other OSs like I stated earlier. Can somebody explain why this is happening. Note: We are able to login to HP box manually using telnet.

推荐答案

这些是 telnet 命令.具体ÿ"是TELNET IAC(Interpret as Command)字符对应的Latin-1图形,ý"是DO命令,$" 是旧的 ENVIRON 选项.您打算发送 WILL 或 WONT 响应.有关详细信息,请参阅 RFC 854 中的 TELNET 规范.

These are telnet commands. Specifically "ÿ" is the Latin-1 graphic corresponding to the TELNET IAC (Interpret as Command) character, "ý" is the DO command, and "$" is the old ENVIRON option. It is intended that you send a WILL or WONT response. See the TELNET specification in RFC 854 for details.

我相信有些 telnet 服务器在客户端先发送它们之前不会发送 telnet 命令,这可以解释为什么您没有看到某些服务器的问题.

I believe that some telnet servers do not send telnet commands until the client sends them first, which may explain why you do not see the issue with some servers.

这篇关于Hpux telnet 使用套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆