示例消息写入tcpclient网络流? [英] sample messages to write into a tcpclient networkstream?

查看:102
本文介绍了示例消息写入tcpclient网络流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经有一个telnet服务器,我们可以通过命令提示符(telnet.exe)访问它们并完成我们的工作。我相信机器是unix机器。然而,那台机器不是我们建造的。通过telnet.exe我们只需提供主机ip。我们在telnet会话中需要做的第一件事就是登录。登录屏幕有一个简单的专有消息;此消息下方出现提示符(login :)。

通过telnet.exe(命令提示符),我们只需键入主机ip即可连接。因此,通过代码我认为我们不需要传递任何消息。因此,样本中提供了此处 ,空白消息(string.Empty)不起作用。

我输了。我不知道如何使用TcpClient类。当我尝试使用代码时,我希望得到专有的消息和内容。但是出现的是什么? $$?
这应该是什么意思吗?

当我们谈到"发送消息"时到tcpserver我们在谈论什么消息?是 rfc854 中提到的消息,如SYN,ACK,AYT?


I是一堆错误交织在一起的好意图

We already have a telnet server which we access via command prompt (telnet.exe) and do our stuff. I believe that machine is a unix machine. However that machine was not built by us. Through the telnet.exe we simply provide the host ip. The first thing we need to do in the telnet session is login. The login screen has a simple proprietary message; the prompt (login:) appears below this message.

Via the telnet.exe (command prompt) we are simply typing the host ip to connect. Hence via code I thought we needn't pass any message. And as a result the in sample provided here , a blank message (string.Empty) didn't work.

I am lost. I don't know how to use the TcpClient class. When I tried the code I was expecting I get that proprietary message, and stuff. But what came out was
$$?
Is that supposed to mean something?

When we talk of "sending messages" to a tcpserver what messages are we talking about? Is it those messages mentioned in the rfc854 like SYN, ACK, AYT?


I am a bundle of mistakes intertwined together with good intentions

推荐答案

Telnet是一个携带控制消息和控制台文本的协议。它使用字节值255来启动控制消息。有可能你收到这样的数据,不太知道会怎么样?
Telnet is a protocol that carries control messages as well as the console text.  It uses byte value 255 to start a control message.  It is possible you're receiving such data, don't quite know how that would become


?然而。看看你收到的原始字节。
? however.  Have a look at the raw bytes you're receiving.


这篇关于示例消息写入tcpclient网络流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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