LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Weird nc behavior on Slackware. Connection doesn't close. (https://www.linuxquestions.org/questions/slackware-14/weird-nc-behavior-on-slackware-connection-doesnt-close-4175719751/)

arfon 12-14-2022 01:14 AM

Weird nc behavior on Slackware. Connection doesn't close.
 
2 Attachment(s)
So, I tried to post this with the commands in the post and Cloudflare blocked the post. I had to put the commands in images for Cloudflare not to block the post. Sorry for the extra step


In terminal 1, I run: [see picture]


In terminal 2, I run: [see picture]


The message comes through to terminal 1 just fine but nc holds the connection open. I ran this on a Linux Mint install and the message comes through and then the connection closes.

Any idea how to get Slackware's nc to close the connection after the message?

UPDATE: -q1 needs to be added to the 'client', not the 'server'

marav 12-14-2022 01:53 AM

-q1 must be on Term. #2
Code:

-q secs                quit after EOF on stdin and delay of secs
Because you are sending data from Term. #2 to Term. #1

arfon 12-14-2022 05:12 AM

Unfortunately, the -q1 didn't work. I think this is because I'm using an echo and not a cat so no EOF.

marav 12-14-2022 05:16 AM

1 Attachment(s)
It works here

arfon 12-14-2022 07:07 AM

1 Attachment(s)
Yeah, I can't explain it... I'm running Slackware64-current-

arfon 12-14-2022 07:10 AM

I'm a dork.... I put -q1 in the wrong terminal... It works, thanks!

marav 12-14-2022 11:03 AM

Quote:

Originally Posted by arfon (Post 6397809)
I'm a dork.... I put -q1 in the wrong terminal... It works, thanks!

Yep
See #2 ;-)


All times are GMT -5. The time now is 03:43 AM.