News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

wininet problem

Started by dougiem, July 08, 2006, 12:51:25 AM

Previous topic - Next topic

dougiem

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.

Tedd

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 ::)
No snowflake in an avalanche feels responsible.