xfire设置连接超时有关问题
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");