not correct socket closing

  • Thread starter Кирилл
  • Start date
Ð

Кирилл

Hi all,
I have got a small script for upload file on http server, and I need
interrupt uploading if I get tired wait.
I create socket:

self.conn = httplib.HTTPConnection("192.168.0.195")
#self.conn.debuglevel = 1
self.conn.request("POST", "/upload/", body, head)
if self.conn.sock:
self.conn.sock.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
struct.pack("ii", 1, 0))


and close it in other thread:

if self.conn.sock:
self.conn.close()

Python notify me what socket have closed, but he continues to send
data.
As can I close it and stop sending of the data?

Best Regards,
Kirill.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,044
Members
48,769
Latest member
Clifft

Latest Threads

Top