通过 tcp/ip 传输不断增长的文件
我正在开发一个项目,其中一个硬件正在生成不断写入文本文件的输出。 我需要做的是在通过简单的 tcp/ip 连接写入该文件时流式传输该文件。
我目前正在尝试通过简单的 netcat 来实现这一点,但 netcat 仅发送在执行时写入的文件部分。它不会继续发送其余部分。
现在我有一个服务器在端口 9000 上侦听 netcat(仅用于测试目的):
netcat -l 9000
发送命令是:
netcat localhost 9000 < c:\OUTPUTFILE
所以根据我的理解,netcat 实际上应该流式传输文件,但一旦开始时存在的所有内容它就会停止死刑已送达。它不会终止连接,只是停止发送新数据。
如何让它连续传输数据?
I have a project I'm working on, where a piece of Hardware is producing output that is continuously being written into a textfile.
What I need to do is to stream that file as it's being written over a simple tcp/ip connection.
I'm currently trying to that through simple netcat, but netcat only sends the part of the file that is written at the time of execution. It doesn't continue to send the rest.
Right now I have a server listening to netcat on port 9000 (simply for test-purposes):
netcat -l 9000
And the send command is:
netcat localhost 9000 < c:\OUTPUTFILE
So in my understanding netcat should actually be streaming the file, but it simply stops once everything that existed at the beginning of the execution has been sent. It doesn't kill the connection, but simply stops sending new data.
How do I get it to stream the data continuously?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试:
Try:
尝试:
try:
尝试 nc:
try nc: