![]() ![]() The echo service is meant to terminate the connection as soon as the other end has shut down its sending direction, so that command should not take any longer than the time it takes to establish the connection, exchanging the data and shutting down. socat sees EOF on its - channel (stdin), then shuts the writing direction of the TCP socket and waits for the remote service to shutdown as well or for 10 seconds of inactivity whichever comes first. So above, after echo writes test\n, it exits, which closes the pipe. When during the timeout interval the read part gives EOF, socat terminates without awaiting the timeout. This timeout only applies to addresses where write and read part can be closed independently. Then, socat waits secondsīefore terminating. When one channel has reached EOF, the write part of the other channel is shut down. It's your ultimate plumbing Swiss Army knife. Socat can do much much much more than the various (different and incompatible) implementations of nc/ netcat, and generally works more reliably. (here waiting for up to 10 seconds for the server to reply and shutdown) I'd recommend socat instead: echo test | socat -t 10 - tcp:server:7 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |