[Python-talk] A few more socket related questions

Lloyd Kvam lkvam at venix.com
Fri Aug 28 16:24:03 EDT 2009


On Fri, 2009-08-28 at 15:10 -0400, bruce.labitt at autoliv.com wrote:
> I looked at netcat after Larry mentioned it.  If I understand
> correctly, netcat will do a file transfer, but not a RAM machine 1 to
> RAM machine 2 transfer.  

Larry used file redirection for his example, but it can be piped to
processes giving you the ram to ram style connection you want.

(untested and Larry sounds like he's made more use of nc than I have)

client1:  generate_complex_numbers | nc server 1234
client2: nc -l -d 1235 | process_fft_results
server: nc -l -d 1234 | fft_processing | nc client 1235

All of the network handling is in nc.  Your code simply reads and writes
streams of data using stdin and stdout.  The flow is: 
        complex numbers to server_port 1234 to fft_processing to
        client_port 1235 to process_fft_results

> Or, I don't understand the tool, nor how to use it yet.
> 
-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice:  603-653-8139
fax:    320-210-3409



More information about the Python-talk mailing list