sending a file through sockets

Bryan Olson fakeaddress at nowhere.org
Sun Jul 7 05:35:08 EDT 2002


Donn Cave wrote:
 > Quoth Bryan Olson:

 > I read your first post, and I thought it was kind of inappropriate.
 > For "my first Internet application" (the original poster's, that is),
 > this was a mighty generous hint and more than adequate.

One problem with e-mail/news is that some subtleties of expression get
lost.  In my defense, I did say "right" and "good advice" to a couple
things.  To those I thought not-so-good, I was intending to be perfectly
matter-of-fact.

I was deliberately pointing out that sockets programming is harder than
it looks.  A novice cannot tell whether an answer is a hint or a
solution.  He may not be ready to worry about signals, but he does need
to know the distance between his question and a robust application.

Also, there's tons of bad sockets code out there, some in the Python
standard library.  I did intend my post for people who were already
doing sockets programming.  Did you check out the signal issue?


 > One would
 > imagine that in the end, the parameter to connect() would have to be
 > filled in by the original poster.

I doubt the original poster would imagine that, and I doubt most of the
more experienced actually knew about the undocumented BSD'ism imitated
by Linux (I didn't).  Obviously "localhost" in place of "" makes the
need to fill in the parameter much more clear.

 > Sure we're literally shutting the power off?  That certainly wasn't
 > what I meant, but I gather it is what you have in mind.

I gathered that you had in mind a kind of any-old-way of ending.  Clean
close of a TCP connection is a deliberate act, and the method you named
doesn't do it.


--Bryan




More information about the Python-list mailing list