The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: dougiem on July 08, 2006, 12:51:25 AM

Title: wininet problem
Post by: dougiem on July 08, 2006, 12:51:25 AM
I have been able to write and read files happily from my web server using the the connection code:

; initialise wininet
       invoke InternetOpen,0,INTERNET_OPEN_TYPE_PRECONFIG,0,0,0
       mov Inet,eax


; setup connection using Host,User and Password (in x, y, and zbuff)
       invoke InternetConnect,hInet,addr xbuff,INTERNET_DEFAULT_FTP_PORT,
              addr ybuff,addr zbuff,INTERNET_SERVICE_FTP,INTERNET_FLAG_PASSIVE,0
        mov Connect,eax


The problem I have is when my server is down/problamatic (not the line), there seems to be no timeout, ie it stays locked.
Should I be looking at connecting on a different thread and using a timer - not sure how to tackle this.... any help

thanks,

             dougiem.
Title: Re: wininet problem
Post by: Tedd on July 10, 2006, 10:41:12 AM
Under normal circumstances, if a socket fails to connect after some period then you should get an error value back indicating "connection timed out" but who knows what this function is doing ::)