如何使用netcat发送文件然后保持连接有效? [英] How to send a file using netcat and then keep the connection alive?

查看:34
本文介绍了如何使用netcat发送文件然后保持连接有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在发出命令:

netcat serveraddress myport < MY_FILE

问题是,一旦文件被发送,netcat 就会发送一条消息来关闭连接.发送该文件后,我需要从控制台写入消息.我记得我做过一些将管道传送到标准输入的事情......是这个吗?

The thing is, that netcat sends a message to close the connection once the file is sent. I need to write messages from the console after sending that file. I remember to have done something to pipileline to stdin.. was it this?

netcat serveraddress myport < MY_FILE | 

现在不行了.

我使用的是 unix.

I'm on unix.

额外信息:这不承担服务器端的控制(例如,在服务器端使用 netcat 来侦听入站连接)

Extra info: This did not assume control on server side (E.G. use netcat on serverside to listen for the inbound connection)

推荐答案

也许你在做:

cat MY_FILE - | ncat ...

(请注意,我故意拼错了 netcat,因为我相信 ncat 是一个优秀的程序.)

(Note that I've intentionally mispelled netcat, because I believe ncat is a superior program.)

这篇关于如何使用netcat发送文件然后保持连接有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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