In a server app I am listening on a socket and reading using an InputStreamReader
.
The client is a simple Bash script, in which I do the following to write to the socket and print the output from it:
#!/bin/bash
exec 3<>/dev/tcp/localhost/9999
echo -e some_text >&3
cat <&3
I wold like to indicate EOF after I send my data via echo
, as-is the 开发者_StackOverflowjava app receives the data sent, but continues to block waiting for more. I need to signal that this one line is the only input.
This link indicates you do
exec 3>&-
Found using google. ;)
To close on the Java side
outputStream.close();
精彩评论