[Python-talk] A few more socket related questions

Lloyd Kvam python at venix.com
Fri Aug 28 16:38:54 EDT 2009


On Fri, 2009-08-28 at 15:26 -0400, Larry Keber wrote:
> bruce.labitt at autoliv.com wrote:
> >> You could also consider using Larry's netcat (nc) suggestion.
> >>
> >>     
> >
> > 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.  Or, I don't understand the tool, nor how to use it yet.
> >
> >   
> 
> Basically, netcat acts as the server.  When your client establishes the 
> socket connection, netcat runs your C FFT program, and all input from 
> the socket gets sent to C program's stdin, and output from stdout gets 
> sent back out the socket to your client.
> 

That's very slick.  That was not clear to me from the man page and I've
always used netcat as a filter.  Thanks for the info.

> So, in this situation, the client would open a socket to the server, and 
> send a command (as you've designed in other posts - including the data 
> size and the data itself). 
> 
> On the server side, upon a connection being established, netcat would 
> invoke your C FFT program and send that command+size+data to the C 
> program's stdin, so it could read it without you having to write C  
> socket code.  Then the C program simply writes the results (maybe using 
> the same kind of protocol: a command like 'result' followed by the 
> result data size followed by 'data' followed by the result data) out to 
> stdout, which netcat magically sends back over the socket to the python 
> client program (which has to call recv() on the socket to pick up the 
> response).
> 
> This is all much more interesting than my actual work :-).
> 
> Larry
> _______________________________________________
> Python-talk mailing list
> Python-talk at dlslug.org
> http://dlslug.org/mailman/listinfo/python-talk
-- 
Lloyd Kvam
Venix Corp
DLSLUG/GNHLUG library
http://dlslug.org/library.html
http://www.librarything.com/catalog/dlslug
http://www.librarything.com/rsshtml/recent/dlslug
http://www.librarything.com/rss/recent/dlslug



More information about the Python-talk mailing list