Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
FormPoster.setTimeout
Sets a network timeout.
Syntax
public void setTimeout(int nTimeout)Parameters
nTimeout
- Timeout in milliseconds.
Description
The
setTimeout
method sets a network timeout. Specify the value in milliseconds. 0 means no timeout.Example
FormPoster fp = new FormPoster(); FTValList vlCookies; fp.setURL("http://myserver/servlet/CatalogManager"); // Add a new row to MyTable FTStatusCode ftStatus = new FTStatusCode(); status = fp.login(true, ftStatus, "myusername", "mypassword"); vlCookies = fp.findAllCookies(); Status = fp.addFile("url", "test.html", "/export/home/temp/test.html", "text/html"); Status = fp.addTextValue("tblname", "MyTable"); Status = fp.addURL("myparameter", "http://server/main.html"); Status = fp.addTextValue("id", "1323"); Status = fp.addTextValue("ftcmd", "addrow"); fp.setCookies(vlCookies); // Don't wait forever for a response fp.setTimeout(200); Status = fp.post(); int nLastErrorCode = fp.getLastError(); String sLastError = fp.getLastErrorStr(); // Fetch the response byte[] byResponse = fp.getRawResponse(); fp.reset(); Status = fp.addFile("url", "body.html", "/export/home/temp/body.html", "text/html"); Status = fp.addTextValue("tblname", "MyTable"); Status = fp.addURL("myparameter", "http://server/index.html"); Status = fp.addTextValue("id", "4567"); Status = fp.addTextValue("ftcmd", "addrow"); Status = fp.post(); fp.login(false, ftStatus, null, null);
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.