[Python-talk] A few more socket related questions
bruce.labitt at autoliv.com
bruce.labitt at autoliv.com
Fri Aug 28 12:05:27 EDT 2009
Thanks for peoples' observations at PySIG last night. I heard folks
muttering why use UDP. This got me thinking about my decision. Maybe I
chose UDP for the wrong reasons. So allow me a few questions... Forgive
me if the questions are malformed, I really don't understand this stuff
yet.
Using TCP, How would one send a large array >> MTU ? Does it still need
to be broken up into chunks? And the chunk size would be...? (In UDP a
chunk is limited to a number slightly less than 2**16)
When would I consider using sendall?
When it comes down to it, what is the real advantage of tcp? The
socket.send documentation still says to check the return value for the
number of bytes sent... Is it just that tcp keeps trying to send? or that
it 'guarantees' delivery. When does it give up?
As I understand it, in tcp the client has to create and destroy a
socket(s) for each transaction.
How does the client know if all the data is sent?
How does the server know it got everything?
Can the server send data to the client without a request? (Delayed
output?)
As seen by the example below:
----------------------------------------------------------------
client sends data for FFT.
Server starts FFT.
Server sends I'm
busy
client receives I'm busy
Server sends
results
client receives results
----------------------------------------------------------------
Or should it be more like:
----------------------------------------------------------------
client sends data for FFT
Server starts FFT.
no response from
server
Server sends
results
client receives results
----------------------------------------------------------------
Can you tell I've never done this kind of thing before :)
-Bruce
OK, I'm going back to my copy of Beej's Guide to Network Programming,
where I'll find some answers, and a bit of confusion too...
******************************
Neither the footer nor anything else in this E-mail is intended to or constitutes an <br>electronic signature and/or legally binding agreement in the absence of an <br>express statement or Autoliv policy and/or procedure to the contrary.<br>This E-mail and any attachments hereto are Autoliv property and may contain legally <br>privileged, confidential and/or proprietary information.<br>The recipient of this E-mail is prohibited from distributing, copying, forwarding or in any way <br>disseminating any material contained within this E-mail without prior written <br>permission from the author. If you receive this E-mail in error, please <br>immediately notify the author and delete this E-mail. Autoliv disclaims all <br>responsibility and liability for the consequences of any person who fails to <br>abide by the terms herein. <br>
******************************
More information about the Python-talk
mailing list