resolveTimeout
A long integer. The value is applied to mapping host names (such as "www.microsoft.com") to IP addresses; the default value is infinite, meaning no timeout.
connectTimeout
A long integer. The value is applied to establishing a communication socket with the target server, with a default timeout value of 60 seconds.
sendTimeout
A long integer. The value applies to sending an individual packet of request data (if any) on the communication socket to the target server. A large request sent to a server will normally be broken up into multiple packets; the send timeout applies to sending each packet individually. The default value is 5 minutes.
receiveTimeout
A long integer. The value applies to receiving a packet of response data from the target server. Large responses will be broken up into multiple packets; the receive timeout applies to fetching each packet of data off the socket. The default value is 60 minutes.
this way is right,thank you ,and all the points are yours.by the way ,can you tell me what's meaning of the parameters 60000,60000,300000,3600000 and obj.Status = 200 ,may i change them?
<%
set obj = server.createObject("MSXML2.ServerXMLHTTP.4.0")
On Error Resume Next
obj.setTimeouts 60000,60000,300000,3600000
obj.Open "HEAD","http://www.mss2xxx.com",FALSE
obj.Send
if Err.Number <> 0 then
Response.Write Err.Description
else
if obj.Status = 200 then
Response.Write "Up"
else
Response.Write "maybe down, returned status:" & obj.Status
end if
end if
set obj = nothing
%>
hahaha, you are right, MSXML2.ServerXMLHTTP.4.0 always gives me "UP". Apparently, Microsoft introduced a bug into MSXML4. But MSXML2.ServerXMLHTTP.3.0 gives "Down or invalid address". the default MSXML parser on my machine is MSXML3, that is why I got the right result
<%
set obj = server.createObject("MSXML2.ServerXMLHTTP")
On Error Resume Next
obj.setTimeouts 60000,60000,300000,3600000
obj.Open "HEAD","http://www.mss22xxx.com",FALSE
obj.Send
if obj.Status = 200 then
Response.Write "up"
else
Response.Write "Down or invalid address"
end if
set obj = nothing
%>
<%
set obj = server.createObject("MSXML2.ServerXMLHTTP")
obj.Open "GET","http://www.mss.com",FALSE
obj.Send
if obj.Status = 200 then
Response.Write "up"
else
Response.Write "Down or invalid address"
end if
set obj = nothing
%>
try something like this on the server, although it is not recommended:
<%
set obj = server.createObject("MSXML2.ServerXMLHTTP")
On Error Resume Next
obj.setTimeouts 60000,60000,300000,3600000
obj.Open "HEAD","http://www.mss.com",FALSE
obj.Send
if obj.Status = 200 then
Response.Write "up"
else
Response.Write "Down or invalid address"
end if
set obj = nothing
%>