PB的POSTURL连接服务器接口有些电脑成功有些电脑返回-6
本人使用PB的posturl做一个远程数据发送的程序,程序在大部分电脑上面都能正常使用,但是有些电脑没法使用,使用posturl的时候返回错误为-6。url正常,服务器端接口为httplistener,直接监听端口,并未使用IIS服务,客户有两个电脑(并非一个局域网,宽带也可能是两个宽带,两个电脑操作系统相同),其中一个电脑正常,一个电脑报错为-6.有哪位大侠知道是啥问题,希望指点一二,如果觉得分数不多,本人可以适当给红包。代码如下:
n_inet in_inet
n_ir in_ir
Blob lblb_args, myreturn
String ls_headers , ls_url , ls_args, as_info, ls_return
Long ll_length, li_ret
uo_utf8_format iuo_format
in_inet = create n_inet
in_ir = create n_ir
iuo_format = create uo_utf8_format
url = "http://198.138.154.89"
ls_args = data
lblb_args = blob(ls_args)
iuo_format.of_unicode_utf8(lblb_args,myreturn)
ll_length = Len(myreturn)
ls_headers = "Content-Length: " + String( ll_length ) + "~n~n"
//ls_headers = "Content-Type:" + "application/x-www-form-urlencoded~n" + "Content-Length:" + String( len(lblb_args) ) + "~n~n";
li_ret = in_inet.PostURL (url, myreturn , ls_headers,80, in_ir) ////此处返回-6
if li_ret <> 1 then
choose case li_ret
case -1
as_info = "General error!"
case -2
as_info = "Invalid URL!"
case -4
as_info = "Cannot connect to the Internet!"
case -5
as_info = "Unsupported secure (HTTPS) connection attempted!"
case -6
as_info = "Internet request failed!"
case else
as_info = "其它未知错误!"
end choose
return "false"
end if
ls_return = in_ir.uf_get_data()
destroy in_ir
destroy in_inet
destroy iuo_format
return ls_return