curl-library
How to stop TCP connections immediately?
Date: Tue, 11 Mar 2003 06:47:24 +0000
Hi all, I'm writing a multithread web crawler for downloading images from
the web. Each thread do the same thing: Connect to a web site, seek images
and download them. And certainly it'll block when connecting to the remote
server since I use block TCP mothed in each thread. So the problem comes: My
program allows users to cancel downloading. It's really a headache when the
thread is blocking since I can not notify that thread to end its work when
it's downling or trying to build a connection to the remote server. How can
I close all threads when users' trying to cancel downloading? Should I kill
the thread in block? That's is the last choice if no other good solution
since kill a thread will cause many problems, such as memory leak. Any one
gives me a piece of hint? Thanks in advance.
Fisher
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-03-11