首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

xfire设置连接超时有关问题

2012-10-26 
xfire设置连接超时问题URL _url new URL(url)HttpURLConnection httpConnection (HttpURLConnection)

xfire设置连接超时问题

URL _url = new URL(url); HttpURLConnection httpConnection = (HttpURLConnection)_url.openConnection(); httpConnection.setReadTimeout(20000);//设置http连接的读超时,单位是毫秒 httpConnection.connect(); Client _client = new Client(httpConnection.getInputStream(), null); _client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, String.valueOf( 20000 ));//设置发送的超时限制,单位是毫秒; _client.setProperty(CommonsHttpMessageSender.DISABLE_KEEP_ALIVE, "true"); _client.setProperty(CommonsHttpMessageSender.DISABLE_EXPECT_CONTINUE, "true");

热点排行