sending a file through sockets

Donn Cave donn at drizzle.com
Sat Jul 6 21:58:17 EDT 2002


Quoth Bryan Olson <fakeaddress at nowhere.org>:
| brueckd at tbye.com wrote:
|> I actually spend
|> most of my days writing network agents in Python (so I do know how to do
|> it "right" or whatever), but I was just posting some code from memory to
|> help the guy out; I think it's pretty obvious that you don't cut code from
|> a Usenet post and paste it into your production system and expect no
|> problems.
|
| O.K., and if you read my first post, I was entirely matter-of-fact in
| pointing out the issues.  No reason to get defensive.  Do you actually
| believe use of INADDR_ANY in connect() is doing it right?

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 would
imagine that in the end, the parameter to connect() would have to be
filled in by the original poster.

|>> On pull-the-plug a recv won't detect the connection loss until the local
|>> system tries a keepalive probe, which is typically two hours.
|>
|> Apparently we're talking about different things because I just tried it
|> and got a socket.error exception ('connection reset by peer') on Windows.
|
| On the recv() side?  Sure doesn't work that way for me.  Any idea how it
| knew?

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.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list