python - Async WinInet fails with ERROR_IO_PENDING -


we have observed wininet problem in windows 7. see in async. mode, when internetreadfile() returns error_io_pending, not trigger internet_status_response_received event. sure receving full response correctly, because have used wireshark capture traffic. application using wininet not. suspected problem related way use wininet api, however, turns out can reproduce issue async. wininet example on msdn. (http://msdn.microsoft.com/en-us/library/windows/desktop/cc185684(v=vs.85).aspx)

i change example connect testing server. testing server sending 20000 bytes of data, that's all. see behavior on win 7 (wininet dll version win7_ie9_rtm.110308-0330). here actual testing server application in python show there nothing special server:

import time socket import *  addr = ("", 80) bufsize = 1024  serversock = socket(af_inet, sock_stream) serversock.setsockopt(sol_socket, so_reuseaddr, 1) serversock.bind(addr) serversock.listen(5) t0 = time.time() while 1:      print 'waiting connection. previous transaction takes %0.3f secs' % (time.time()-t0)     t0 = time.time()     clientsock, addr = serversock.accept()     print '...connected from:', addr     data = clientsock.recv(bufsize)     print 'recv data:' + repr(data)          send_data = "a" * 20482     send_data += "supo\r\n\r\n"     clientsock.send(send_data) 

regards,


Comments