Re: Connecting Fortran code to TCP/IP socket



On Sep 28, 5:31 am, feenberg <feenb...@xxxxxxxxx> wrote:
On Sep 28, 7:04 am, Den7 <rrr7...@xxxxxxxxx> wrote:> 1) I am wondering how to make Fortran program communicate with the
server via streaming TCP/IP socket connection.

...

If you invoke your program with the netcat command the standard input
will be drawn from a socket, and its standard output can be sent to a
socket. It is all very easy.

   nc host.example.com port -e command

Runs "command" with the standard output going to host.example.com:port
and the standard input coming back from that server.  For some time I
was using this, but found that if the command did too much input and
output, the process would eventually hang. If the transfer was mostly
in one direction, there was no problem. There are several newer
implementaions of netcat now, perhaps one or more of them has overcome
this problem. Or perhaps it had to do with the sever. In any case, you
asked for no more than 20 lines - here it is in 1 line!

Note that many implementations of netcat have other names and some do
not implement the -e option.

Daniel Feenberg
feenb...@xxxxxxxx

Thanks, the idea sounds cool.
Couldn't find netcat for latest Windows OS though, all are older
builds for Win 95/98/NT
and of course for Linux...
.



Relevant Pages

  • Re: Using cmd-line pipe with and without xargs
    ... 'prog | anotherprog' puts the standard output of prog into ... the standard input of anotherprog." ... The OS supplies the command line arguments in an analogous way. ... what I did was neglect to read stdin from my ...
    (comp.unix.shell)
  • Re: Connecting Fortran code to TCP/IP socket
    ... server via streaming TCP/IP socket connection. ... If you invoke your program with the netcat command the standard input ...
    (comp.lang.fortran)
  • Re: Connecting Fortran code to TCP/IP socket
    ... will be drawn from a socket, and its standard output can be sent to a ... and the standard input coming back from that server. ... Couldn't find netcat for latest Windows OS though, ...
    (comp.lang.fortran)
  • Re: strict grep when patterns are presented on standard input
    ... > Can strict option/quotes etc. be applied to the grep when it becomes ... > its arguments from standard input in the pipe (i.e. as standard output from ... I can add just another sed command to the pipe ...
    (comp.unix.shell)
  • Re: BASH issue with spaces in file names..
    ... But if you really need the 'ls' command, you can take a pipe: ... du doesn't use standard input. ... column when its standard output isn't a terminal. ...
    (comp.unix.shell)

Loading